mirror of
https://github.com/danog/psalm.git
synced 2025-01-21 21:31:13 +01:00
Fix #955 - always check third argument of array_splice
This commit is contained in:
parent
0691763803
commit
4ef2aafdd8
@ -367,7 +367,7 @@ class CallChecker
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!isset($args[2]) || !isset($args[3])) {
|
||||
if (!isset($args[2])) {
|
||||
return;
|
||||
}
|
||||
|
||||
@ -381,6 +381,10 @@ class CallChecker
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!isset($args[3])) {
|
||||
return;
|
||||
}
|
||||
|
||||
$replacement_arg = $args[3]->value;
|
||||
|
||||
if (ExpressionChecker::analyze(
|
||||
|
@ -913,7 +913,9 @@ class FunctionCallTest extends TestCase
|
||||
$a = [1, 2, 3];
|
||||
$c = $a;
|
||||
$b = ["a", "b", "c"];
|
||||
array_splice($a, -1, 1, $b);',
|
||||
array_splice($a, -1, 1, $b);
|
||||
$d = [1, 2, 3];
|
||||
array_splice($d, -1, 1);',
|
||||
'assertions' => [
|
||||
'$a' => 'array<int, string|int>',
|
||||
'$b' => 'array{0:string, 1:string, 2:string}',
|
||||
|
Loading…
x
Reference in New Issue
Block a user