1
0
Fork 0

fix: don't save classes without name to index

pull/680/head
Felix Becker 2018-11-11 02:53:49 +01:00
parent 2a2fa1ca8d
commit 52179d0973
1 changed files with 7 additions and 1 deletions

View File

@ -1233,7 +1233,13 @@ class DefinitionResolver
if (
$node instanceof PhpParser\ClassLike
) {
return (string) $node->getNamespacedName();
$className = (string)$node->getNamespacedName();
// An (invalid) class declaration without a name will have an empty string as name,
// but should not define an FQN
if ($className === '') {
return null;
}
return $className;
}
// INPUT OUTPUT: