1
0
Fork 0

Fix error getting completions for 'new static' type (#405)

pull/412/head
Rob Lourens 2017-06-15 03:44:03 -07:00 committed by Felix Becker
parent 8d1732ed02
commit 3b633369a7
1 changed files with 4 additions and 3 deletions

View File

@ -906,11 +906,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') {