mirror of
https://github.com/danog/psalm.git
synced 2024-11-30 04:39:00 +01:00
Add array_slice call to methods whose return types we can infer
This commit is contained in:
parent
8c68861cc3
commit
95ebf5178a
@ -416,7 +416,11 @@ class FunctionChecker extends FunctionLikeChecker
|
||||
? $first_arg->inferredType->types['array']
|
||||
: null;
|
||||
|
||||
if ($call_map_key === 'array_values' || $call_map_key === 'array_unique' || $call_map_key === 'array_intersect') {
|
||||
if ($call_map_key === 'array_values' ||
|
||||
$call_map_key === 'array_unique' ||
|
||||
$call_map_key === 'array_intersect' ||
|
||||
$call_map_key === 'array_slice'
|
||||
) {
|
||||
if ($first_arg_array_generic || $first_arg_array_objectlike) {
|
||||
if ($first_arg_array_generic) {
|
||||
$inner_type = clone $first_arg_array_generic->type_params[1];
|
||||
|
Loading…
Reference in New Issue
Block a user