Skip to content

Commit fc7d373

Browse files
committed
Check for existence of namespacedName property
PHP-Parsers `isAnonymous` doesn't always work for some reason. Signed-off-by: Ilija Tovilo <ilija.tovilo@me.com>
1 parent a9a1a47 commit fc7d373

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/Rules/Deprecations/InstantiationOfDeprecatedClassRule.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ public function processNode(Node $node, Scope $scope): array
4747
if ($node->class instanceof Name) {
4848
$referencedClasses[] = $scope->resolveName($node->class);
4949
} elseif ($node->class instanceof Class_) {
50-
if ($node->class->isAnonymous()) {
50+
if (!isset($node->class->namespacedName)) {
5151
return [];
5252
}
5353

0 commit comments

Comments
 (0)