Disclude anonymous class members from definitions
parent
5bd827fa4d
commit
219c018ab2
|
@ -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
|
||||||
|
|
Loading…
Reference in New Issue