REDROOM
PHP 8.2.31
Path:
Logout
Edit File
Size: 1.63 KB
Close
//opt/cpanel/ea-wappspector/vendor/rector/rector/rules/CodingStyle/Guard/StaticGuard.php
Text
Base64
<?php declare (strict_types=1); namespace Rector\CodingStyle\Guard; use PhpParser\Node; use PhpParser\Node\Expr\ArrowFunction; use PhpParser\Node\Expr\Closure; use PhpParser\Node\Expr\StaticCall; use PhpParser\Node\Expr\Variable; use PHPStan\Reflection\MethodReflection; use Rector\PhpParser\Node\BetterNodeFinder; use Rector\Reflection\ReflectionResolver; final class StaticGuard { /** * @readonly * @var \Rector\PhpParser\Node\BetterNodeFinder */ private $betterNodeFinder; /** * @readonly * @var \Rector\Reflection\ReflectionResolver */ private $reflectionResolver; public function __construct(BetterNodeFinder $betterNodeFinder, ReflectionResolver $reflectionResolver) { $this->betterNodeFinder = $betterNodeFinder; $this->reflectionResolver = $reflectionResolver; } /** * @param \PhpParser\Node\Expr\Closure|\PhpParser\Node\Expr\ArrowFunction $node */ public function isLegal($node) : bool { if ($node->static) { return \false; } $nodes = $node instanceof Closure ? $node->stmts : [$node->expr]; return !(bool) $this->betterNodeFinder->findFirst($nodes, function (Node $subNode) : bool { if (!$subNode instanceof StaticCall) { return $subNode instanceof Variable && $subNode->name === 'this'; } $methodReflection = $this->reflectionResolver->resolveMethodReflectionFromStaticCall($subNode); if (!$methodReflection instanceof MethodReflection) { return \false; } return !$methodReflection->isStatic(); }); } }
Save
Close
Exit & Reset
Text mode: syntax highlighting auto-detects file type.
Directory Contents
Dirs: 0 × Files: 1
Delete Selected
Select All
Select None
Sort:
Name
Size
Modified
Enable drag-to-move
Name
Size
Perms
Modified
Actions
StaticGuard.php
1.63 KB
lrw-r--r--
2024-11-08 13:59:10
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
Zip Selected
If ZipArchive is unavailable, a
.tar
will be created (no compression).