1
0
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:
orklah 2022-01-08 22:59:31 +01:00 committed by GitHub
commit 771fbfade2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 3 deletions

View File

@ -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]);

View File

@ -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' => [