PHP 8.2.31
Preview: Php4ConstructorClassMethodAnalyzer.php Size: 804 B
/opt/cpanel/ea-wappspector/vendor/rector/rector/rules/Php70/NodeAnalyzer/Php4ConstructorClassMethodAnalyzer.php

<?php

declare (strict_types=1);
namespace Rector\Php70\NodeAnalyzer;

use PhpParser\Node\Stmt\ClassMethod;
use PHPStan\Analyser\Scope;
use PHPStan\Reflection\ClassReflection;
final class Php4ConstructorClassMethodAnalyzer
{
    public function detect(ClassMethod $classMethod, Scope $scope) : bool
    {
        // catch only classes without namespace
        if ($scope->getNamespace() !== null) {
            return \false;
        }
        if ($classMethod->isAbstract()) {
            return \false;
        }
        if ($classMethod->isStatic()) {
            return \false;
        }
        $classReflection = $scope->getClassReflection();
        if (!$classReflection instanceof ClassReflection) {
            return \false;
        }
        return !$classReflection->isAnonymous();
    }
}

Directory Contents

Dirs: 0 × Files: 2

Name Size Perms Modified Actions
4.40 KB lrw-r--r-- 2024-11-08 13:59:10
Edit Download
804 B lrw-r--r-- 2024-11-08 13:59:10
Edit Download

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