1
0
Fork 0

fix test & revert last commit

pull/347/head
jens1o 2017-04-17 16:32:19 +02:00
parent 93fae1bb13
commit 2625a1062b
1 changed files with 6 additions and 2 deletions

View File

@ -50,6 +50,7 @@ class SymbolInformation
{
$parent = $node->getAttribute('parentNode');
$symbol = new self;
$setDefaultName = true;
if (
$node instanceof Node\Expr\FuncCall
@ -62,6 +63,7 @@ class SymbolInformation
// define('TEST_DEFINE_CONSTANT', false);
$symbol->kind = SymbolKind::CONSTANT;
$symbol->name = (string)$node->args[0]->value->value;
$setDefaultName = false;
} else if ($node instanceof Node\Stmt\Class_ || $node instanceof Node\Stmt\Trait_) {
$symbol->kind = SymbolKind::CLASS_;
} else if ($node instanceof Node\Stmt\Interface_) {
@ -96,8 +98,10 @@ class SymbolInformation
$symbol->name = $node->var->name;
} else if ($node instanceof Node\Expr\ClosureUse) {
$symbol->name = $node->var;
} else if (isset($node->name) && !isset($symbol->name)) {
} else if (isset($node->name)) {
if ($setDefaultName) {
$symbol->name = (string)$node->name;
}
} else {
return null;
}