Skip to content

Commit

Permalink
Fix "ERROR: PossiblyInvalidArgument - src/ReturnController.php:42:33 …
Browse files Browse the repository at this point in the history
…- Argument 2 of add_action expects callable(WP_REST_Server):void, but possibly different type impure-callable():void provided (see https://psalm.dev/092)".
  • Loading branch information
remcotolsma committed May 3, 2024
1 parent 709c2d2 commit b439bba
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/ReturnController.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@

use Pronamic\WordPress\Pay\Payments\Payment;
use WP_REST_Request;
use WP_REST_Server;

/**
* Return controller class
Expand Down Expand Up @@ -47,9 +48,10 @@ public function setup() {
*
* @link https://developer.wordpress.org/rest-api/extending-the-rest-api/adding-custom-endpoints/
* @link https://developer.wordpress.org/reference/hooks/rest_api_init/
* @param WP_REST_Server $wp_rest_server Server object.
* @return void
*/
public function rest_api_init() {
public function rest_api_init( $wp_rest_server ) {
\register_rest_route(
Integration::REST_ROUTE_NAMESPACE,
'/return/(?P<payment_id>[\d]+)',
Expand Down

0 comments on commit b439bba

Please sign in to comment.