From eb61fda03a53472bc2b1e164c7d9ae71d73cd4b3 Mon Sep 17 00:00:00 2001 From: Henrique Mouta Date: Mon, 21 Oct 2024 11:00:22 +0100 Subject: [PATCH] Fix PHPStan (not including tests) --- src/rest-api/class-base-endpoint.php | 2 +- src/rest-api/stats/trait-related-posts.php | 2 +- src/services/class-cached-service-endpoint.php | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/rest-api/class-base-endpoint.php b/src/rest-api/class-base-endpoint.php index 1b2855829..ecea575a6 100644 --- a/src/rest-api/class-base-endpoint.php +++ b/src/rest-api/class-base-endpoint.php @@ -196,7 +196,7 @@ public function get_full_endpoint( string $route = '' ): string { * @return string */ public function get_endpoint_slug(): string { - return $this->api_controller->prefix_route( '' ) . $this->get_endpoint_name(); + return $this->api_controller->prefix_route( '' ) . static::get_endpoint_name(); } /** diff --git a/src/rest-api/stats/trait-related-posts.php b/src/rest-api/stats/trait-related-posts.php index b0528b469..c165388de 100644 --- a/src/rest-api/stats/trait-related-posts.php +++ b/src/rest-api/stats/trait-related-posts.php @@ -115,7 +115,7 @@ public function get_related_posts_of_url( WP_REST_Request $request, string $url /** * The raw related posts data, received by the API. * - * @var array|WP_Error $related_posts_request + * @var array>|WP_Error $related_posts_request */ $related_posts_request = $this->content_api->get_related_posts_with_url( $url, diff --git a/src/services/class-cached-service-endpoint.php b/src/services/class-cached-service-endpoint.php index 75ac2b3e3..fc19d1561 100644 --- a/src/services/class-cached-service-endpoint.php +++ b/src/services/class-cached-service-endpoint.php @@ -75,7 +75,7 @@ private function get_cache_key( array $args ): string { $api_service = $this->service_endpoint->api_service; $cache_key = 'parsely_api_' . - wp_hash( $api_service->get_base_url() ) . '_' . + wp_hash( $api_service->get_api_url() ) . '_' . wp_hash( $this->get_endpoint() ) . '_' . wp_hash( (string) wp_json_encode( $args ) );