include traits and interfaces when retrieving fqn
parent
651e6be08a
commit
21cee77624
|
@ -1095,7 +1095,7 @@ class TolerantDefinitionResolver implements DefinitionResolverInterface
|
|||
// }
|
||||
else if ($node instanceof Tolerant\Node\MethodDeclaration) {
|
||||
// Class method: use ClassName->methodName() as name
|
||||
$class = $node->getFirstAncestor(Tolerant\Node\Statement\ClassDeclaration::class);
|
||||
$class = $node->getFirstAncestor(Tolerant\Node\Statement\ClassDeclaration::class, Tolerant\Node\Statement\TraitDeclaration::class, Tolerant\Node\Statement\InterfaceDeclaration::class);
|
||||
if (!isset($class->name)) {
|
||||
// Ignore anonymous classes
|
||||
return null;
|
||||
|
@ -1116,7 +1116,9 @@ class TolerantDefinitionResolver implements DefinitionResolverInterface
|
|||
else if (
|
||||
$node instanceof Tolerant\Node\Expression\Variable &&
|
||||
($propertyDeclaration = $node->getFirstAncestor(Tolerant\Node\PropertyDeclaration::class)) !== null &&
|
||||
($classDeclaration = $node->getFirstAncestor(Tolerant\Node\Statement\ClassDeclaration::class)) !== null)
|
||||
($classDeclaration =
|
||||
$node->getFirstAncestor(Tolerant\Node\Statement\ClassDeclaration::class, Tolerant\Node\Statement\InterfaceDeclaration::class, Tolerant\Node\Statement\TraitDeclaration::class)
|
||||
) !== null)
|
||||
{
|
||||
if ($propertyDeclaration->isStatic()) {
|
||||
// Static Property: use ClassName::$propertyName as name
|
||||
|
|
Loading…
Reference in New Issue