1
0
Fork 0

fix merge conflict and abstract detection

pull/391/head
jens1o 2017-06-09 21:59:18 +02:00
parent 0c9ee8b33d
commit 454e078cd5
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| = 8; |final| = 5 // check whether it is not an abstract class
($node->abstractOrFinalModifier === null || $node->abstractOrFinalModifier->length !== 8) ($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;
} }