X7ROOT File Manager
Current Path:
/opt/cpanel/ea-wappspector/vendor/rector/rector/src/NodeManipulator
opt
/
cpanel
/
ea-wappspector
/
vendor
/
rector
/
rector
/
src
/
NodeManipulator
/
??
..
??
AssignManipulator.php
(2.92 KB)
??
BinaryOpManipulator.php
(4.83 KB)
??
ClassConstManipulator.php
(2.61 KB)
??
ClassDependencyManipulator.php
(9.08 KB)
??
ClassInsertManipulator.php
(2.61 KB)
??
ClassManipulator.php
(1.79 KB)
??
ClassMethodAssignManipulator.php
(1.85 KB)
??
ClassMethodManipulator.php
(2.18 KB)
??
ClassMethodPropertyFetchManipulator.php
(4.25 KB)
??
FuncCallManipulator.php
(1.08 KB)
??
FunctionLikeManipulator.php
(755 B)
??
IfManipulator.php
(6.19 KB)
??
PropertyFetchAssignManipulator.php
(2.46 KB)
??
PropertyManipulator.php
(8.65 KB)
??
StmtsManipulator.php
(3.08 KB)
Editing: ClassManipulator.php
<?php declare (strict_types=1); namespace Rector\NodeManipulator; use PhpParser\Node\Stmt\Class_; use PHPStan\Reflection\ReflectionProvider; use PHPStan\Type\ObjectType; use Rector\NodeNameResolver\NodeNameResolver; final class ClassManipulator { /** * @readonly * @var \Rector\NodeNameResolver\NodeNameResolver */ private $nodeNameResolver; /** * @readonly * @var \PHPStan\Reflection\ReflectionProvider */ private $reflectionProvider; public function __construct(NodeNameResolver $nodeNameResolver, ReflectionProvider $reflectionProvider) { $this->nodeNameResolver = $nodeNameResolver; $this->reflectionProvider = $reflectionProvider; } public function hasParentMethodOrInterface(ObjectType $objectType, string $oldMethod) : bool { if (!$this->reflectionProvider->hasClass($objectType->getClassName())) { return \false; } $classReflection = $this->reflectionProvider->getClass($objectType->getClassName()); $ancestorClassReflections = \array_merge($classReflection->getParents(), $classReflection->getInterfaces()); foreach ($ancestorClassReflections as $ancestorClassReflection) { if (!$ancestorClassReflection->hasMethod($oldMethod)) { continue; } return \true; } return \false; } /** * @api phpunit */ public function hasTrait(Class_ $class, string $desiredTrait) : bool { foreach ($class->getTraitUses() as $traitUse) { foreach ($traitUse->traits as $traitName) { if (!$this->nodeNameResolver->isName($traitName, $desiredTrait)) { continue; } return \true; } } return \false; } }
Upload File
Create Folder