Skip to content

Commit 6a36828

Browse files
committed
avoid useless array
1 parent 6a41a7f commit 6a36828

File tree

1 file changed

+2
-12
lines changed

1 file changed

+2
-12
lines changed

src/CompletionProvider.php

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -202,13 +202,8 @@ public function provideCompletion(PhpDocument $doc, Position $pos): CompletionLi
202202
);
203203

204204
// The namespaces of the symbol and its parents (eg the implemented interfaces)
205-
$namespaces = [];
206205
foreach ($this->expandParentFqns($fqns) as $namespace) {
207-
$namespaces[] = $namespace;
208-
}
209-
210-
// Collect namespaces definitions
211-
foreach ($namespaces as $namespace) {
206+
// Collect namespaces definitions
212207
foreach ($this->index->getDefinitionsForNamespace($namespace) as $fqn => $def) {
213208
// Add the object access operator to only get members of all parents
214209
$prefix = $namespace . '->';
@@ -237,13 +232,8 @@ public function provideCompletion(PhpDocument $doc, Position $pos): CompletionLi
237232
);
238233

239234
// The namespaces of the symbol and its parents (eg the implemented interfaces)
240-
$namespaces = [];
241235
foreach ($this->expandParentFqns($fqns) as $namespace) {
242-
$namespaces[] = $namespace;
243-
}
244-
245-
// Collect namespaces definitions
246-
foreach ($namespaces as $namespace) {
236+
// Collect namespaces definitions
247237
foreach ($this->index->getDefinitionsForNamespace($namespace) as $fqn => $def) {
248238
// Append :: operator to only get static members of all parents
249239
$prefix = strtolower($namespace . '::');

0 commit comments

Comments
 (0)