remove broken list() support, I didn't think this through
parent
744d3ba10a
commit
bcb630db90
|
@ -32,10 +32,6 @@ foreach ($array3 as $key => $value) {
|
|||
$
|
||||
}
|
||||
|
||||
foreach ($array1 as list($z, $y)) {
|
||||
$
|
||||
}
|
||||
|
||||
foreach ($bar->test() as $value) {
|
||||
$
|
||||
}
|
||||
|
|
|
@ -1107,8 +1107,10 @@ class DefinitionResolver
|
|||
return new Types\Mixed_();
|
||||
}
|
||||
|
||||
// FOREACH VALUE
|
||||
if ($node instanceof Node\ForeachValue || $node->getFirstAncestor(Node\ForeachValue::class)) {
|
||||
// FOREACH VALUE/VARIABLE
|
||||
if ($node instanceof Node\ForeachValue
|
||||
|| ($node instanceof Node\Expression\Variable && $node->parent instanceof Node\ForeachValue)
|
||||
) {
|
||||
$foreach = $node->getFirstAncestor(Node\Statement\ForeachStatement::class);
|
||||
$collectionType = $this->resolveExpressionNodeToType($foreach->forEachCollectionName);
|
||||
if ($collectionType instanceof Types\Array_) {
|
||||
|
|
|
@ -676,33 +676,8 @@ class CompletionTest extends TestCase
|
|||
),
|
||||
]
|
||||
],
|
||||
'foreach with list()' => [
|
||||
new Position(35, 5),
|
||||
[
|
||||
new CompletionItem(
|
||||
'$z',
|
||||
CompletionItemKind::VARIABLE,
|
||||
'\\Foo\\Bar|\\stdClass',
|
||||
null,
|
||||
null,
|
||||
null,
|
||||
null,
|
||||
new TextEdit(new Range(new Position(35, 5), new Position(35, 5)), 'z')
|
||||
),
|
||||
new CompletionItem(
|
||||
'$y',
|
||||
CompletionItemKind::VARIABLE,
|
||||
'\\Foo\\Bar|\\stdClass',
|
||||
null,
|
||||
null,
|
||||
null,
|
||||
null,
|
||||
new TextEdit(new Range(new Position(35, 5), new Position(35, 5)), 'y')
|
||||
),
|
||||
]
|
||||
],
|
||||
'foreach function call' => [
|
||||
new Position(39, 5),
|
||||
new Position(35, 5),
|
||||
[
|
||||
new CompletionItem(
|
||||
'$value',
|
||||
|
@ -712,7 +687,7 @@ class CompletionTest extends TestCase
|
|||
null,
|
||||
null,
|
||||
null,
|
||||
new TextEdit(new Range(new Position(39, 5), new Position(39, 5)), 'value')
|
||||
new TextEdit(new Range(new Position(35, 5), new Position(35, 5)), 'value')
|
||||
),
|
||||
]
|
||||
],
|
||||
|
|
Loading…
Reference in New Issue