1
0
Fork 0

Fix error getting completions for 'new static' type

pull/405/head
Rob Lourens 2017-06-12 17:36:21 -07:00
parent 42d0c7b714
commit c1a2bc8412
1 changed files with 4 additions and 3 deletions

View File

@ -896,11 +896,12 @@ class DefinitionResolver
// Anonymous class // Anonymous class
return new Types\Object_; return new Types\Object_;
} }
$className = (string)$class->getResolvedName(); if ($class instanceof PhpParser\Token && $class->kind === PhpParser\TokenKind::StaticKeyword) {
// `new static`
if ($className === 'static') {
return new Types\Static_; return new Types\Static_;
} }
$className = (string)$class->getResolvedName();
if ($className === 'self' || $className === 'parent') { if ($className === 'self' || $className === 'parent') {
$classNode = $class->getFirstAncestor(Node\Statement\ClassDeclaration::class); $classNode = $class->getFirstAncestor(Node\Statement\ClassDeclaration::class);
if ($className === 'parent') { if ($className === 'parent') {