Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ public function register_routes(): void {
*
* @since 0.1.0
*
* @param \WP_REST_Request $request Full details about the request.
* @param \WP_REST_Request<array<string,mixed>> $request Full details about the request.
* @return \WP_REST_Response Response object on success.
*/
public function get_items( $request ) {
Expand Down Expand Up @@ -144,7 +144,7 @@ public function get_items( $request ) {
*
* @since 0.1.0
*
* @param \WP_REST_Request $request Full details about the request.
* @param \WP_REST_Request<array<string,mixed>> $request Full details about the request.
* @return \WP_REST_Response|\WP_Error Response object on success, or WP_Error object on failure.
*/
public function get_item( $request ) {
Expand All @@ -167,7 +167,7 @@ public function get_item( $request ) {
*
* @since 0.1.0
*
* @param \WP_REST_Request $request Full details about the request.
* @param \WP_REST_Request<array<string,mixed>> $request Full details about the request.
* @return bool True if the request has read access.
*/
public function get_permissions_check( $request ) {
Expand All @@ -179,8 +179,8 @@ public function get_permissions_check( $request ) {
*
* @since 0.1.0
*
* @param \WP_Ability $ability The ability object.
* @param \WP_REST_Request $request Request object.
* @param \WP_Ability $ability The ability object.
* @param \WP_REST_Request<array<string,mixed>> $request Request object.
* @return \WP_REST_Response Response object.
*/
public function prepare_item_for_response( $ability, $request ) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ public function register_routes(): void {
*
* @since 0.1.0
*
* @param \WP_REST_Request $request Full details about the request.
* @param \WP_REST_Request<array<string,mixed>> $request Full details about the request.
* @return \WP_REST_Response|\WP_Error Response object on success, or WP_Error object on failure.
*/
public function run_ability_with_method_check( $request ) {
Expand Down Expand Up @@ -118,7 +118,7 @@ public function run_ability_with_method_check( $request ) {
*
* @since 0.1.0
*
* @param \WP_REST_Request $request Full details about the request.
* @param \WP_REST_Request<array<string,mixed>> $request Full details about the request.
* @return \WP_REST_Response|\WP_Error Response object on success, or WP_Error object on failure.
*/
public function run_ability( $request ) {
Expand Down Expand Up @@ -148,7 +148,7 @@ public function run_ability( $request ) {
*
* @since 0.1.0
*
* @param \WP_REST_Request $request Full details about the request.
* @param \WP_REST_Request<array<string,mixed>> $request Full details about the request.
* @return true|\WP_Error True if the request has execution permission, WP_Error object otherwise.
*/
public function run_ability_permissions_check( $request ) {
Expand Down Expand Up @@ -178,7 +178,7 @@ public function run_ability_permissions_check( $request ) {
*
* @since 0.1.0
*
* @param \WP_REST_Request $request The request object.
* @param \WP_REST_Request<array<string,mixed>> $request The request object.
* @return array<string, mixed> The input parameters.
*/
private function get_input_from_request( $request ) {
Expand Down
11 changes: 0 additions & 11 deletions phpstan.neon.dist
Original file line number Diff line number Diff line change
Expand Up @@ -29,14 +29,3 @@ parameters:
analyseAndScan:
- node_modules (?)

# Ignore specific errors
ignoreErrors:
# WP_REST_Request is not actually a generic class in WordPress core.
# PHPStan's WordPress stubs appear to define it as generic for type checking,
# but WordPress itself doesn't use generics. This seems to be an incompatibility
# between static analysis tools and WordPress's actual implementation.
-
message: '#has parameter \$request with generic class WP_REST_Request but does not specify its types#'
paths:
- includes/rest-api/**/*.php

Loading