1
0
Fork 0

Optimized if

pull/116/head
Michal Niewrzal 2016-10-26 11:36:22 +02:00
parent 2357bf7929
commit cd57312e6a
1 changed files with 2 additions and 4 deletions

View File

@ -45,11 +45,9 @@ function getReferencedFqn(Node $node)
$grandParent = $parent->getAttribute('parentNode');
if ($grandParent instanceof Node\Stmt\GroupUse) {
$name = $grandParent->prefix . '\\' . $name;
} else if ($grandParent instanceof Node\Stmt\Use_) {
if ($grandParent->type === Node\Stmt\Use_::TYPE_FUNCTION) {
} else if ($grandParent instanceof Node\Stmt\Use_ && $grandParent->type === Node\Stmt\Use_::TYPE_FUNCTION) {
$name .= '()';
}
}
// Only the name node should be considered a reference, not the New_ node itself
} else if ($parent instanceof Node\Expr\New_) {
if (!($parent->class instanceof Node\Name)) {