From 42e7690753fa9e14f6a524c1262ef07d9efb2850 Mon Sep 17 00:00:00 2001 From: Konstantin Obenland Date: Thu, 9 Jan 2025 10:59:29 -0600 Subject: [PATCH] phpcs --- includes/rest/class-webfinger-controller.php | 6 +++--- tests/class-test-rest-controller-testcase.php | 2 -- tests/includes/rest/class-test-webfinger-controller.php | 8 ++++---- 3 files changed, 7 insertions(+), 9 deletions(-) diff --git a/includes/rest/class-webfinger-controller.php b/includes/rest/class-webfinger-controller.php index 6a03ee95b..ee75e7add 100644 --- a/includes/rest/class-webfinger-controller.php +++ b/includes/rest/class-webfinger-controller.php @@ -143,16 +143,16 @@ public function get_item_schema() { 'items' => array( 'type' => 'object', 'properties' => array( - 'rel' => array( + 'rel' => array( 'description' => 'The relation type of the link.', 'type' => 'string', 'required' => true, ), - 'type' => array( + 'type' => array( 'description' => 'The content type of the link.', 'type' => 'string', ), - 'href' => array( + 'href' => array( 'description' => 'The target URL of the link.', 'type' => 'string', 'format' => 'uri', diff --git a/tests/class-test-rest-controller-testcase.php b/tests/class-test-rest-controller-testcase.php index 1a2922390..3f1e6a58c 100644 --- a/tests/class-test-rest-controller-testcase.php +++ b/tests/class-test-rest-controller-testcase.php @@ -26,7 +26,6 @@ public function set_up() { parent::set_up(); add_filter( 'rest_url', array( $this, 'filter_rest_url_for_leading_slash' ), 10, 2 ); - /** @var \WP_REST_Server $wp_rest_server */ global $wp_rest_server; $wp_rest_server = new \Spy_REST_Server(); do_action( 'rest_api_init', $wp_rest_server ); @@ -38,7 +37,6 @@ public function set_up() { public function tear_down() { remove_filter( 'rest_url', array( $this, 'test_rest_url_for_leading_slash' ) ); - /** @var WP_REST_Server $wp_rest_server */ global $wp_rest_server; $wp_rest_server = null; diff --git a/tests/includes/rest/class-test-webfinger-controller.php b/tests/includes/rest/class-test-webfinger-controller.php index 9ccac2205..75c95642f 100644 --- a/tests/includes/rest/class-test-webfinger-controller.php +++ b/tests/includes/rest/class-test-webfinger-controller.php @@ -117,7 +117,7 @@ public function test_get_item_with_invalid_resource() { * @covers ::get_item */ public function test_get_item_with_missing_resource() { - $request = new \WP_REST_Request( 'GET', '/' . ACTIVITYPUB_REST_NAMESPACE . '/webfinger' ); + $request = new \WP_REST_Request( 'GET', '/' . ACTIVITYPUB_REST_NAMESPACE . '/webfinger' ); $response = rest_get_server()->dispatch( $request ); $this->assertEquals( 400, $response->get_status() ); @@ -143,8 +143,8 @@ public function test_webfinger_data_filter() { \add_filter( 'webfinger_data', - function( $data, $resource ) use ( $test_data ) { - $this->assertEquals( 'acct:test_user@example.org', $resource ); + function ( $data, $webfinger ) use ( $test_data ) { + $this->assertEquals( 'acct:test_user@example.org', $webfinger ); return $test_data; }, 10, @@ -167,7 +167,7 @@ function( $data, $resource ) use ( $test_data ) { */ public function test_get_item_with_author_url() { $author_url = \get_author_posts_url( self::$user->ID ); - $request = new \WP_REST_Request( 'GET', '/' . ACTIVITYPUB_REST_NAMESPACE . '/webfinger' ); + $request = new \WP_REST_Request( 'GET', '/' . ACTIVITYPUB_REST_NAMESPACE . '/webfinger' ); $request->set_param( 'resource', $author_url ); $response = rest_get_server()->dispatch( $request );