Skip to content

Commit e6dd87b

Browse files
committed
Dive into a trait that starts on the same line as the one in the reflection
1 parent 1cd97b4 commit e6dd87b

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/Analyser/NodeScopeResolver.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2587,7 +2587,7 @@ private function processTraitUse(Node\Stmt\TraitUse $node, MutatingScope $classS
25872587
private function processNodesForTraitUse($node, ClassReflection $traitReflection, MutatingScope $scope, \Closure $nodeCallback): void
25882588
{
25892589
if ($node instanceof Node) {
2590-
if ($node instanceof Node\Stmt\Trait_ && $traitReflection->getName() === (string) $node->namespacedName) {
2590+
if ($node instanceof Node\Stmt\Trait_ && $traitReflection->getName() === (string) $node->namespacedName && $traitReflection->getNativeReflection()->getStartLine() === $node->getStartLine()) {
25912591
$this->processStmtNodes($node, $node->stmts, $scope->enterTrait($traitReflection), $nodeCallback);
25922592
return;
25932593
}

0 commit comments

Comments
 (0)