Update SymbolInformation.php
parent
2625a1062b
commit
8ac306f653
|
@ -50,7 +50,6 @@ class SymbolInformation
|
|||
{
|
||||
$parent = $node->getAttribute('parentNode');
|
||||
$symbol = new self;
|
||||
$setDefaultName = true;
|
||||
|
||||
if (
|
||||
$node instanceof Node\Expr\FuncCall
|
||||
|
@ -63,7 +62,6 @@ 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_) {
|
||||
|
@ -92,6 +90,8 @@ class SymbolInformation
|
|||
} else {
|
||||
return null;
|
||||
}
|
||||
|
||||
if (!isset($symbol->name)) {
|
||||
if ($node instanceof Node\Name) {
|
||||
$symbol->name = (string)$node;
|
||||
} else if ($node instanceof Node\Expr\Assign || $node instanceof Node\Expr\AssignOp) {
|
||||
|
@ -99,12 +99,11 @@ class SymbolInformation
|
|||
} else if ($node instanceof Node\Expr\ClosureUse) {
|
||||
$symbol->name = $node->var;
|
||||
} else if (isset($node->name)) {
|
||||
if ($setDefaultName) {
|
||||
$symbol->name = (string)$node->name;
|
||||
}
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
$symbol->location = Location::fromNode($node);
|
||||
if ($fqn !== null) {
|
||||
|
|
Loading…
Reference in New Issue