Skip to content
Permalink
Browse files

Fix #1578 - fix empty array error

  • Loading branch information...
muglug committed Apr 26, 2019
1 parent dbcedd3 commit 82e0bcafac723fdf5007a31a7ae74af1736c9f6f
Showing with 22 additions and 1 deletion.
  1. +1 −1 src/Psalm/Type/Union.php
  2. +21 −0 tests/FileManipulationTest.php
@@ -1071,7 +1071,7 @@ public function replaceTemplateTypesWithStandins(
$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 @@ function foo(A $a, string $var) {
['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 {

0 comments on commit 82e0bca

Please sign in to comment.
You can’t perform that action at this time.