Skip to content

Commit d6f5132

Browse files
authored
Add default value to WP_REST_Request generic template (#409)
Fixes #408
1 parent 5171cb6 commit d6f5132

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

functionMap.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -288,7 +288,7 @@
288288
'WP_List_Table::set_pagination_args' => ['void', 'args' => 'array{total_items?: int, total_pages?: int, per_page?: int}'],
289289
'WP_Query' => [null, '@phpstan-property-read bool $query_vars_changed' => '', '@phpstan-property-read bool|string $query_vars_hash' => '', '@phpstan-method void init_query_flags()' => ''],
290290
'WP_Query::have_posts' => [null, '@phpstan-impure' => ''],
291-
'WP_REST_Request' => [null, '@phpstan-template' => 'T of array', '@phpstan-implements' => 'ArrayAccess<key-of<T>, value-of<T>>'],
291+
'WP_REST_Request' => [null, '@phpstan-template' => 'T of array = array<string, mixed>', '@phpstan-implements' => 'ArrayAccess<key-of<T>, value-of<T>>'],
292292
'WP_REST_Request::get_param' => ['T[TOffset]|null', '@phpstan-template' => 'TOffset of key-of<T>', 'key' => 'TOffset'],
293293
'WP_REST_Request::get_params' => ['T'],
294294
'WP_REST_Request::has_param' => [null, 'key' => 'key-of<T>'],

wordpress-stubs.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72889,7 +72889,7 @@ public function merge_with(&$other)
7288972889
* @since 4.4.0
7289072890
*
7289172891
* @link https://www.php.net/manual/en/class.arrayaccess.php
72892-
* @phpstan-template T of array
72892+
* @phpstan-template T of array = array<string, mixed>
7289372893
* @phpstan-implements ArrayAccess<key-of<T>, value-of<T>>
7289472894
*/
7289572895
#[\AllowDynamicProperties]

0 commit comments

Comments
 (0)