Skip to content

Commit ba17015

Browse files
committed
Allow int keys when calling Redis methods
In 5bfc0f9, risky casting was invoked as a way to show there is an issue here. However, it is not always possible to use a string. For instance, there is no such thing as this in PHP: ["1" => "whatever"]. If you try to create such an array, you will obtain [1 => "whatever"] instead. Ironically, this was copied in jetbrains/phpstorm, which is used in PHPStan, which exhibited that false positive. See JetBrains/phpstorm-stubs#1454
1 parent 5f07988 commit ba17015

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

stubs/extensions/redis.phpstub

+2-2
Original file line numberDiff line numberDiff line change
@@ -276,12 +276,12 @@ class Redis {
276276
public function move(string $key, int $index): bool {}
277277

278278
/**
279-
* @param array<string, string>
279+
* @param array<int|string, string>
280280
*/
281281
public function mset($key_values): Redis|bool {}
282282

283283
/**
284-
* @param array<string, string>
284+
* @param array<int|string, string>
285285
*/
286286
public function msetnx($key_values): Redis|bool {}
287287

0 commit comments

Comments
 (0)