From 6a368280691d0ba24a36ada8992398dc2fcf9f36 Mon Sep 17 00:00:00 2001 From: Nicolas MURE Date: Thu, 10 Aug 2017 20:42:08 +0200 Subject: [PATCH] avoid useless array --- src/CompletionProvider.php | 14 ++------------ 1 file changed, 2 insertions(+), 12 deletions(-) diff --git a/src/CompletionProvider.php b/src/CompletionProvider.php index 5934813..0548e49 100644 --- a/src/CompletionProvider.php +++ b/src/CompletionProvider.php @@ -202,13 +202,8 @@ class CompletionProvider ); // The namespaces of the symbol and its parents (eg the implemented interfaces) - $namespaces = []; foreach ($this->expandParentFqns($fqns) as $namespace) { - $namespaces[] = $namespace; - } - - // Collect namespaces definitions - foreach ($namespaces as $namespace) { + // Collect namespaces definitions foreach ($this->index->getDefinitionsForNamespace($namespace) as $fqn => $def) { // Add the object access operator to only get members of all parents $prefix = $namespace . '->'; @@ -237,13 +232,8 @@ class CompletionProvider ); // The namespaces of the symbol and its parents (eg the implemented interfaces) - $namespaces = []; foreach ($this->expandParentFqns($fqns) as $namespace) { - $namespaces[] = $namespace; - } - - // Collect namespaces definitions - foreach ($namespaces as $namespace) { + // Collect namespaces definitions foreach ($this->index->getDefinitionsForNamespace($namespace) as $fqn => $def) { // Append :: operator to only get static members of all parents $prefix = strtolower($namespace . '::');