1
0
Fork 0

Disclude anonymous class members from definitions

pull/357/head
Sara Itani 2017-04-10 21:58:08 -07:00
parent 5bd827fa4d
commit 219c018ab2
1 changed files with 3 additions and 1 deletions

View File

@ -1096,6 +1096,7 @@ class TolerantDefinitionResolver implements DefinitionResolverInterface
else if ($node instanceof Tolerant\Node\MethodDeclaration) { else if ($node instanceof Tolerant\Node\MethodDeclaration) {
// Class method: use ClassName->methodName() as name // Class method: use ClassName->methodName() as name
$class = $node->getFirstAncestor( $class = $node->getFirstAncestor(
Tolerant\Node\Expression\ObjectCreationExpression::class,
Tolerant\Node\Statement\ClassDeclaration::class, Tolerant\Node\Statement\ClassDeclaration::class,
Tolerant\Node\Statement\InterfaceDeclaration::class, Tolerant\Node\Statement\InterfaceDeclaration::class,
Tolerant\Node\Statement\TraitDeclaration::class Tolerant\Node\Statement\TraitDeclaration::class
@ -1122,11 +1123,12 @@ class TolerantDefinitionResolver implements DefinitionResolverInterface
($propertyDeclaration = $node->getFirstAncestor(Tolerant\Node\PropertyDeclaration::class)) !== null && ($propertyDeclaration = $node->getFirstAncestor(Tolerant\Node\PropertyDeclaration::class)) !== null &&
($classDeclaration = ($classDeclaration =
$node->getFirstAncestor( $node->getFirstAncestor(
Tolerant\Node\Statement\ObjectCreationExpression::class,
Tolerant\Node\Statement\ClassDeclaration::class, Tolerant\Node\Statement\ClassDeclaration::class,
Tolerant\Node\Statement\InterfaceDeclaration::class, Tolerant\Node\Statement\InterfaceDeclaration::class,
Tolerant\Node\Statement\TraitDeclaration::class Tolerant\Node\Statement\TraitDeclaration::class
) )
) !== null) ) !== null && !($classDeclaration instanceof Tolerant\Node\Statement\ObjectCreationExpression))
{ {
if ($propertyDeclaration->isStatic()) { if ($propertyDeclaration->isStatic()) {
// Static Property: use ClassName::$propertyName as name // Static Property: use ClassName::$propertyName as name