Skip to content

Commit f6b15ca

Browse files
committed
fix array_udiff stub
1 parent c368b45 commit f6b15ca

File tree

2 files changed

+9
-7
lines changed

2 files changed

+9
-7
lines changed

Diff for: stubs/arrayFunctions.stub

+7-5
Original file line numberDiff line numberDiff line change
@@ -50,17 +50,19 @@ function uksort(array &$array, callable $callback): bool
5050
}
5151

5252
/**
53-
* @template T of mixed
53+
* @template TV of mixed
54+
* @template TK of mixed
5455
*
55-
* @param array<T> $one
56-
* @param array<T> $two
57-
* @param callable(T, T): int $three
56+
* @param array<TK, TV> $one
57+
* @param array<TK, TV> $two
58+
* @param callable(TV, TV): int $three
59+
* @return array<TK, TV>
5860
*/
5961
function array_udiff(
6062
array $one,
6163
array $two,
6264
callable $three
63-
): int {}
65+
): array {}
6466

6567
/**
6668
* @param array<array-key, mixed> $value

Diff for: tests/PHPStan/Rules/Functions/CallToFunctionParametersRuleTest.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -640,11 +640,11 @@ public function testArrayUdiffCallback(): void
640640
14,
641641
],
642642
[
643-
'Parameter #1 $arr1 of function array_udiff expects array<string>, null given.',
643+
'Parameter #1 $arr1 of function array_udiff expects array<(int&TK)|(string&TK), string>, null given.',
644644
20,
645645
],
646646
[
647-
'Parameter #2 $arr2 of function array_udiff expects array<string>, null given.',
647+
'Parameter #2 $arr2 of function array_udiff expects array<(int&TK)|(string&TK), string>, null given.',
648648
21,
649649
],
650650
[

0 commit comments

Comments
 (0)