1
0
Fork 0

Merge branch 'jens1o-improve-abstract-detection' into jens1o-keywords

pull/396/head
jens1o 2017-06-10 14:30:59 +02:00
commit b7dbfc7ef6
1 changed files with 2 additions and 7 deletions

View File

@ -176,8 +176,8 @@ class DefinitionResolver
// Determines whether the suggestion will show after "new" // Determines whether the suggestion will show after "new"
$def->canBeInstantiated = ( $def->canBeInstantiated = (
$node instanceof Node\Statement\ClassDeclaration && $node instanceof Node\Statement\ClassDeclaration &&
// use text's length for speedup: |abstract| = 7; |final| = 5 // check whether it is not an abstract class
($node->abstractOrFinalModifier === null || $node->abstractOrFinalModifier->length !== 7) ($node->abstractOrFinalModifier === null || $node->abstractOrFinalModifier->kind !== PhpParser\TokenKind::AbstractKeyword)
); );
// Interfaces, classes, traits, namespaces, functions, and global const elements // Interfaces, classes, traits, namespaces, functions, and global const elements
@ -1194,11 +1194,6 @@ class DefinitionResolver
if ($tag->getVariableName() === \ltrim($variableName, "$")) { if ($tag->getVariableName() === \ltrim($variableName, "$")) {
return $tag; return $tag;
} }
} else if ($node instanceof Node\Expr\FuncCall && $node->name instanceof Node\Name && strtolower((string)$node->name) === 'define') {
if (!isset($node->args[0]) || !($node->args[0]->value instanceof Node\Scalar\String_)) {
return null;
}
return (string)$node->args[0]->value->value;
} }
return null; return null;
} }