Skip to content

Commit

Permalink
address phpcs sniffs
Browse files Browse the repository at this point in the history
  • Loading branch information
manewc committed Sep 26, 2024
1 parent 5b66892 commit 8d24cc1
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 7 deletions.
9 changes: 6 additions & 3 deletions src/api/class-jw-player-api.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,9 @@ class JW_Player_API implements API_Requester {

/**
* Constructor.
*
* @param string $api_key The API key.
* @param string $api_secret The API secret.
*/
public function __construct( string $api_key, string $api_secret ) {
$this->api_key = $api_key;
Expand Down Expand Up @@ -86,7 +89,7 @@ public function get_request_url(): string {
*/
public function get_request_args(): array {

Check failure on line 90 in src/api/class-jw-player-api.php

View workflow job for this annotation

GitHub Actions / pr-tests (8.2)

Method Alley\WP\WP_Video_Sync\API\JW_Player_API::get_request_args() return type has no value type specified in iterable type array.
return [
'headers' => [
'headers' => [
'Authorization' => 'Bearer ' . $this->api_secret,
'Content-Type' => 'application/json',
],
Expand All @@ -96,7 +99,7 @@ public function get_request_args(): array {
/**
* Parse the API error response.
*
* @param mixed $response_object The API response object.
* @param array $response_object The API response object.
*
* @return array
*/
Expand All @@ -109,7 +112,7 @@ public function parse_error( array $response_object ): array {
/**
* Parse the API successful response.
*
* @param mixed $response_object The API response object.
* @param array $response_object The API response object.
*
* @return array
*/
Expand Down
9 changes: 5 additions & 4 deletions src/api/class-request.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@

use Alley\WP\WP_Video_Sync\Interfaces\API_Requester;

/**
* Perform an API request.
*/
class Request {

/**
Expand All @@ -25,8 +28,6 @@ class Request {
*/
public function __construct( API_Requester $api_requester ) {
$this->api_requester = $api_requester;

return $this;
}

/**
Expand Down Expand Up @@ -58,7 +59,7 @@ public function get_request_args(): array {
/**
* Parse the API response.
*
* @param mixed $response
* @param mixed $response The API response.
* @return array
*/
private function parse_response( mixed $response ): array {

Check failure on line 65 in src/api/class-request.php

View workflow job for this annotation

GitHub Actions / pr-tests (8.2)

Method Alley\WP\WP_Video_Sync\API\Request::parse_response() return type has no value type specified in iterable type array.
Expand Down Expand Up @@ -99,7 +100,7 @@ public function get(): array {
$this->get_request_args()
);
} else {
$api_request = wp_remote_get(
$api_request = wp_remote_get( // phpcs:ignore WordPressVIPMinimum.Functions.RestrictedFunctions.wp_remote_get_wp_remote_get
$this->api_requester->get_request_url(),
$this->get_request_args()
);
Expand Down

0 comments on commit 8d24cc1

Please sign in to comment.