1
0
mirror of https://github.com/danog/psalm.git synced 2025-01-22 13:51:54 +01:00

add test case for uksort()

This commit is contained in:
hirokinoue 2022-04-29 00:33:08 +09:00
parent 8c64bddf29
commit 139948e774

View File

@ -687,15 +687,22 @@ class ArrayFunctionCallTest extends TestCase
],
'uksort' => [
'<?php
function foo (string $a, string $b): int {
return $a <=> $b;
}
$array = ["b" => 1, "a" => 2];
uksort(
$array,
function (string $a, string $b) {
return $a <=> $b;
}
"foo"
);
$emptyArray = [];
uksort(
$emptyArray,
"foo"
);',
'assertions' => [
'$array' => 'array<string, int>',
'$array' => 'non-empty-array<string, int>',
'$emptyArray' => 'array<empty, empty>',
],
],
'arrayMergeTKeyedArray' => [