1
0
Fork 0

avoid useless array

pull/451/head
Nicolas MURE 2017-08-10 20:42:08 +02:00
parent 6a41a7f0dc
commit 6a36828069
No known key found for this signature in database
GPG Key ID: E5B036F9145C4CAA
1 changed files with 2 additions and 12 deletions

View File

@ -202,13 +202,8 @@ class CompletionProvider
); );
// The namespaces of the symbol and its parents (eg the implemented interfaces) // The namespaces of the symbol and its parents (eg the implemented interfaces)
$namespaces = [];
foreach ($this->expandParentFqns($fqns) as $namespace) { foreach ($this->expandParentFqns($fqns) as $namespace) {
$namespaces[] = $namespace; // Collect namespaces definitions
}
// Collect namespaces definitions
foreach ($namespaces as $namespace) {
foreach ($this->index->getDefinitionsForNamespace($namespace) as $fqn => $def) { foreach ($this->index->getDefinitionsForNamespace($namespace) as $fqn => $def) {
// Add the object access operator to only get members of all parents // Add the object access operator to only get members of all parents
$prefix = $namespace . '->'; $prefix = $namespace . '->';
@ -237,13 +232,8 @@ class CompletionProvider
); );
// The namespaces of the symbol and its parents (eg the implemented interfaces) // The namespaces of the symbol and its parents (eg the implemented interfaces)
$namespaces = [];
foreach ($this->expandParentFqns($fqns) as $namespace) { foreach ($this->expandParentFqns($fqns) as $namespace) {
$namespaces[] = $namespace; // Collect namespaces definitions
}
// Collect namespaces definitions
foreach ($namespaces as $namespace) {
foreach ($this->index->getDefinitionsForNamespace($namespace) as $fqn => $def) { foreach ($this->index->getDefinitionsForNamespace($namespace) as $fqn => $def) {
// Append :: operator to only get static members of all parents // Append :: operator to only get static members of all parents
$prefix = strtolower($namespace . '::'); $prefix = strtolower($namespace . '::');