Skip to content
This repository was archived by the owner on Jul 18, 2018. It is now read-only.

Commit 5496d00

Browse files
roblourenslialan
authored andcommitted
Fix error getting completions for 'new static' type (felixfbecker#405)
1 parent 5dbd6e2 commit 5496d00

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

src/DefinitionResolver.php

+4-3
Original file line numberDiff line numberDiff line change
@@ -934,11 +934,12 @@ public function resolveClassNameToType($class): Type
934934
// Anonymous class
935935
return new Types\Object_;
936936
}
937-
$className = (string)$class->getResolvedName();
938-
939-
if ($className === 'static') {
937+
if ($class instanceof PhpParser\Token && $class->kind === PhpParser\TokenKind::StaticKeyword) {
938+
// `new static`
940939
return new Types\Static_;
941940
}
941+
$className = (string)$class->getResolvedName();
942+
942943
if ($className === 'self' || $className === 'parent') {
943944
$classNode = $class->getFirstAncestor(Node\Statement\ClassDeclaration::class);
944945
if ($className === 'parent') {

0 commit comments

Comments
 (0)