mirror of
https://github.com/danog/psalm.git
synced 2025-01-21 21:31:13 +01:00
Fix #1578 - fix empty array error
This commit is contained in:
parent
dbcedd300b
commit
82e0bcafac
@ -1071,7 +1071,7 @@ class Union
|
||||
$new_generic_params = [];
|
||||
|
||||
foreach ($extends_list as $key => $value) {
|
||||
if (is_int($key)) {
|
||||
if (is_string($key)) {
|
||||
$new_generic_params[] = $value;
|
||||
}
|
||||
}
|
||||
|
@ -1796,6 +1796,27 @@ class FileManipulationTest extends TestCase
|
||||
['PossiblyUnusedMethod'],
|
||||
true,
|
||||
],
|
||||
'dontRemovePossiblyUnusedMethodWithCallUserFuncCall' => [
|
||||
'<?php
|
||||
class A {
|
||||
public function foo() : void {}
|
||||
}
|
||||
|
||||
function foo(A $a, string $var) {
|
||||
call_user_func([$a, $var]);
|
||||
}',
|
||||
'<?php
|
||||
class A {
|
||||
public function foo() : void {}
|
||||
}
|
||||
|
||||
function foo(A $a, string $var) {
|
||||
call_user_func([$a, $var]);
|
||||
}',
|
||||
'7.1',
|
||||
['PossiblyUnusedMethod'],
|
||||
true,
|
||||
],
|
||||
'dontRemovePossiblyUnusedMethodWithVariableCallableLhsCall' => [
|
||||
'<?php
|
||||
class A {
|
||||
|
Loading…
x
Reference in New Issue
Block a user