File tree Expand file tree Collapse file tree 2 files changed +7
-5
lines changed
Expand file tree Collapse file tree 2 files changed +7
-5
lines changed Original file line number Diff line number Diff line change 44
55namespace Rector \Bridge \PhpParser ;
66
7+ use PhpParser \Node ;
78use Nette \Loaders \RobotLoader ;
89use PHPStan \Node \AnonymousClassNode ;
910use Rector \PhpParser \Node \CustomNode \FileWithoutNamespace ;
1213final class NodeClassFinder
1314{
1415 /**
15- * @return array<class-string<\PhpParser\ Node>>
16+ * @return array<class-string<Node>>
1617 */
1718 public static function find (): array
1819 {
@@ -29,12 +30,12 @@ public static function find(): array
2930 $ nodeClasses = array_keys ($ robotLoader ->getIndexedClasses ());
3031
3132 $ instantiableNodeClasses = array_filter ($ nodeClasses , function (string $ nodeClass ): bool {
32- $ nodeClassReflection = new ReflectionClass ($ nodeClass );
33- if ($ nodeClassReflection ->isAbstract ()) {
33+ $ reflectionClass = new ReflectionClass ($ nodeClass );
34+ if ($ reflectionClass ->isAbstract ()) {
3435 return false ;
3536 }
3637
37- return ! $ nodeClassReflection ->isInterface ();
38+ return ! $ reflectionClass ->isInterface ();
3839 });
3940
4041 // this is needed, as PHPStan replaces the Class_ node of anonymous class completely
Original file line number Diff line number Diff line change 44
55namespace Rector \PhpParser \NodeTraverser ;
66
7+ use Rector \Bridge \PhpParser \NodeClassFinder ;
78use PhpParser \Node ;
89use PhpParser \Node \Stmt ;
910use PhpParser \NodeVisitor ;
@@ -88,7 +89,7 @@ private function prepareNodeVisitors(): void
8889 // 2. iterate through them
8990 /** @var RectorInterface $visitor */
9091 foreach ($ this ->visitors as $ visitor ) {
91- foreach (\ Rector \ Bridge \ PhpParser \ NodeClassFinder::find () as $ nodeClass ) {
92+ foreach (NodeClassFinder::find () as $ nodeClass ) {
9293 foreach ($ visitor ->getNodeTypes () as $ matchingNodeType ) {
9394 if (is_a ($ nodeClass , $ matchingNodeType , true )) {
9495 $ this ->visitorsPerNodeClass [$ nodeClass ][] = $ visitor ;
You can’t perform that action at this time.
0 commit comments