Skip to content

Commit

Permalink
fix return type of WP_REST_Request::get_param
Browse files Browse the repository at this point in the history
  • Loading branch information
IanDelMar committed Jul 14, 2024
1 parent 0e17158 commit d707624
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions functionMap.php
Original file line number Diff line number Diff line change
Expand Up @@ -70,10 +70,10 @@
'rest_ensure_response' => ['($response is WP_Error ? WP_Error : WP_REST_Response)'],
'WP_REST_Request' => [null, '@phpstan-template' => 'T of array', '@phpstan-implements' => 'ArrayAccess<key-of<T>, value-of<T>>'],
'WP_REST_Request::offsetExists' => [null, 'offset' => 'key-of<T>'],
'WP_REST_Request::offsetGet' => ['T[TOffset]', '@phpstan-template' => 'TOffset of key-of<T>', 'offset' => 'TOffset'],
'WP_REST_Request::offsetGet' => ['($offset is TOffset ? T[TOffset] : null)', '@phpstan-template' => 'TOffset of key-of<T>', 'offset' => 'TOffset'],
'WP_REST_Request::offsetSet' => ['void', '@phpstan-template' => 'TOffset of key-of<T>', 'offset' => 'TOffset', 'value' => 'T[TOffset]'],
'WP_REST_Request::offsetUnset' => ['void', '@phpstan-template' => 'TOffset of key-of<T>', 'offset' => 'TOffset'],
'WP_REST_Request::get_param' => ['T[TOffset]', '@phpstan-template' => 'TOffset of key-of<T>', 'key' => 'TOffset'],
'WP_REST_Request::get_param' => ['($key is TOffset ? T[TOffset] : null)', '@phpstan-template' => 'TOffset of key-of<T>', 'key' => 'TOffset'],
'WP_REST_Request::get_params' => ['T'],
'WP_REST_Request::set_param' => ['void', '@phpstan-template' => 'TOffset of key-of<T>', 'key' => 'TOffset', 'value' => 'T[TOffset]'],
'WP_REST_Request::has_param' => [null, 'key' => 'key-of<T>'],
Expand Down
4 changes: 2 additions & 2 deletions wordpress-stubs.php
Original file line number Diff line number Diff line change
Expand Up @@ -68946,7 +68946,7 @@ protected function get_parameter_order()
* @return mixed|null Value if set, null otherwise.
* @phpstan-template TOffset of key-of<T>
* @phpstan-param TOffset $key
* @phpstan-return T[TOffset]
* @phpstan-return ($key is TOffset ? T[TOffset] : null)
*/
public function get_param($key)
{
Expand Down Expand Up @@ -69261,7 +69261,7 @@ public function offsetExists($offset)
* @return mixed|null Value if set, null otherwise.
* @phpstan-template TOffset of key-of<T>
* @phpstan-param TOffset $offset
* @phpstan-return T[TOffset]
* @phpstan-return ($offset is TOffset ? T[TOffset] : null)
*/
#[\ReturnTypeWillChange]
public function offsetGet($offset)
Expand Down

0 comments on commit d707624

Please sign in to comment.