Skip to content

Commit 77bfdc5

Browse files
mad-brillerondrejmirtes
authored andcommitted
Return early in CachingVistor to avoid always-false instanceof checks.
1 parent b735b66 commit 77bfdc5

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/Reflection/BetterReflection/SourceLocator/CachingVisitor.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,8 @@ public function enterNode(Node $node): ?int
3434
{
3535
if ($node instanceof Namespace_) {
3636
$this->currentNamespaceNode = $node;
37+
38+
return null;
3739
}
3840

3941
if ($node instanceof Node\Stmt\ClassLike) {

0 commit comments

Comments
 (0)