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,10 +45,8 @@ function getReferencedFqn(Node $node)
$grandParent = $parent->getAttribute('parentNode'); $grandParent = $parent->getAttribute('parentNode');
if ($grandParent instanceof Node\Stmt\GroupUse) { if ($grandParent instanceof Node\Stmt\GroupUse) {
$name = $grandParent->prefix . '\\' . $name; $name = $grandParent->prefix . '\\' . $name;
} else if ($grandParent instanceof Node\Stmt\Use_) { } else if ($grandParent instanceof Node\Stmt\Use_ && $grandParent->type === Node\Stmt\Use_::TYPE_FUNCTION) {
if ($grandParent->type === Node\Stmt\Use_::TYPE_FUNCTION) { $name .= '()';
$name .= '()';
}
} }
// Only the name node should be considered a reference, not the New_ node itself // Only the name node should be considered a reference, not the New_ node itself
} else if ($parent instanceof Node\Expr\New_) { } else if ($parent instanceof Node\Expr\New_) {