mirror of
https://github.com/danog/psalm.git
synced 2024-11-27 04:45:20 +01:00
Merge pull request #7350 from orklah/hrtime3
set the is_list flag for the array inferred for hrtime
This commit is contained in:
commit
771fbfade2
@ -331,6 +331,7 @@ class FunctionCallReturnTypeFetcher
|
||||
Type::getInt()
|
||||
]);
|
||||
$keyed_array->sealed = true;
|
||||
$keyed_array->is_list = true;
|
||||
return new Union([$keyed_array]);
|
||||
|
||||
case 'get_called_class':
|
||||
@ -446,6 +447,7 @@ class FunctionCallReturnTypeFetcher
|
||||
Type::getInt()
|
||||
]);
|
||||
$keyed_array->sealed = true;
|
||||
$keyed_array->is_list = true;
|
||||
|
||||
if ((string) $first_arg_type === 'false') {
|
||||
return new Union([$keyed_array]);
|
||||
|
@ -1054,9 +1054,9 @@ class FunctionCallTest extends TestCase
|
||||
$d = hrtime(false);',
|
||||
'assertions' => [
|
||||
'$a' => 'int',
|
||||
'$b' => 'array{0: int, 1: int}',
|
||||
'$c' => 'array{0: int, 1: int}|int',
|
||||
'$d' => 'array{0: int, 1: int}',
|
||||
'$b' => 'array{int, int}',
|
||||
'$c' => 'array{int, int}|int',
|
||||
'$d' => 'array{int, int}',
|
||||
],
|
||||
],
|
||||
'PHP73-hrtimeCanBeFloat' => [
|
||||
|
Loading…
Reference in New Issue
Block a user