Skip to content

Commit bbfdfcc

Browse files
committed
[rector] Rector fixes
1 parent 23ba100 commit bbfdfcc

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

rules/CodeQuality/Rector/Class_/GetRepositoryServiceLocatorToRepositoryServiceInjectionRector.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
namespace Rector\Doctrine\CodeQuality\Rector\Class_;
66

7+
use PhpParser\Node\Stmt\Function_;
78
use PhpParser\Node;
89
use PhpParser\Node\Expr\MethodCall;
910
use PhpParser\Node\Expr\PropertyFetch;
@@ -116,7 +117,7 @@ public function refactor(Node $node): ?Class_
116117
$this->traverseNodesWithCallable($node->stmts, function (Node $node) use (
117118
&$repositoryPropertyMetadatas
118119
): PropertyFetch|int|null {
119-
if ($node instanceof Class_ || $node instanceof Node\Stmt\Function_) {
120+
if ($node instanceof Class_ || $node instanceof Function_) {
120121
// avoid nested anonymous class or function
121122
return NodeVisitor::DONT_TRAVERSE_CURRENT_AND_CHILDREN;
122123
}

0 commit comments

Comments
 (0)