Skip to content

Commit 9242932

Browse files
schlndhondrejmirtes
authored andcommitted
fix array_udiff stub
1 parent 3046fa9 commit 9242932

File tree

2 files changed

+9
-7
lines changed

2 files changed

+9
-7
lines changed

stubs/arrayFunctions.stub

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -58,17 +58,19 @@ function uksort(array &$array, callable $callback): bool
5858
}
5959

6060
/**
61-
* @template T of mixed
61+
* @template TV of mixed
62+
* @template TK of mixed
6263
*
63-
* @param array<T> $one
64-
* @param array<T> $two
65-
* @param callable(T, T): int $three
64+
* @param array<TK, TV> $one
65+
* @param array<TK, TV> $two
66+
* @param callable(TV, TV): int $three
67+
* @return array<TK, TV>
6668
*/
6769
function array_udiff(
6870
array $one,
6971
array $two,
7072
callable $three
71-
): int {}
73+
): array {}
7274

7375
/**
7476
* @param array<array-key, mixed> $value

tests/PHPStan/Rules/Functions/CallToFunctionParametersRuleTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -642,11 +642,11 @@ public function testArrayUdiffCallback(): void
642642
14,
643643
],
644644
[
645-
'Parameter #1 $arr1 of function array_udiff expects array<string>, null given.',
645+
'Parameter #1 $arr1 of function array_udiff expects array<(int&TK)|(string&TK), string>, null given.',
646646
20,
647647
],
648648
[
649-
'Parameter #2 $arr2 of function array_udiff expects array<string>, null given.',
649+
'Parameter #2 $arr2 of function array_udiff expects array<(int&TK)|(string&TK), string>, null given.',
650650
21,
651651
],
652652
[

0 commit comments

Comments
 (0)