mirror of
https://github.com/danog/psalm.git
synced 2025-01-22 05:41:20 +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;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!isset($args[2]) || !isset($args[3])) {
|
if (!isset($args[2])) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -381,6 +381,10 @@ class CallChecker
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!isset($args[3])) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
$replacement_arg = $args[3]->value;
|
$replacement_arg = $args[3]->value;
|
||||||
|
|
||||||
if (ExpressionChecker::analyze(
|
if (ExpressionChecker::analyze(
|
||||||
|
@ -913,7 +913,9 @@ class FunctionCallTest extends TestCase
|
|||||||
$a = [1, 2, 3];
|
$a = [1, 2, 3];
|
||||||
$c = $a;
|
$c = $a;
|
||||||
$b = ["a", "b", "c"];
|
$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' => [
|
'assertions' => [
|
||||||
'$a' => 'array<int, string|int>',
|
'$a' => 'array<int, string|int>',
|
||||||
'$b' => 'array{0:string, 1:string, 2:string}',
|
'$b' => 'array{0:string, 1:string, 2:string}',
|
||||||
|
Loading…
x
Reference in New Issue
Block a user