From cd57312e6aeeb3b975a0026aea1512aa038a2e83 Mon Sep 17 00:00:00 2001 From: Michal Niewrzal Date: Wed, 26 Oct 2016 11:36:22 +0200 Subject: [PATCH] Optimized if --- src/Fqn.php | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/Fqn.php b/src/Fqn.php index d60ba9d..dbf670b 100644 --- a/src/Fqn.php +++ b/src/Fqn.php @@ -45,10 +45,8 @@ 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) { - $name .= '()'; - } + } 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_) {