PHP 8.2.31
Preview: HasMagicGetSetGuard.php Size: 901 B
/opt/cpanel/ea-wappspector/vendor/rector/rector/rules/Naming/Guard/HasMagicGetSetGuard.php

<?php

declare (strict_types=1);
namespace Rector\Naming\Guard;

use PHPStan\Reflection\ReflectionProvider;
use Rector\Naming\ValueObject\PropertyRename;
final class HasMagicGetSetGuard
{
    /**
     * @readonly
     * @var \PHPStan\Reflection\ReflectionProvider
     */
    private $reflectionProvider;
    public function __construct(ReflectionProvider $reflectionProvider)
    {
        $this->reflectionProvider = $reflectionProvider;
    }
    public function isConflicting(PropertyRename $propertyRename) : bool
    {
        if (!$this->reflectionProvider->hasClass($propertyRename->getClassLikeName())) {
            return \false;
        }
        $classReflection = $this->reflectionProvider->getClass($propertyRename->getClassLikeName());
        if ($classReflection->hasMethod('__set')) {
            return \true;
        }
        return $classReflection->hasMethod('__get');
    }
}

Directory Contents

Dirs: 1 × Files: 3

Name Size Perms Modified Actions
- drwxr-xr-x 2024-11-08 13:59:10
Edit Download
8.22 KB lrw-r--r-- 2024-11-08 13:59:10
Edit Download
1.36 KB lrw-r--r-- 2024-11-08 13:59:10
Edit Download
901 B lrw-r--r-- 2024-11-08 13:59:10
Edit Download

If ZipArchive is unavailable, a .tar will be created (no compression).