| @@ -18,9 +18,9 @@ | ||
| 18 | 18 | |
| 19 | 19 | /** |
| 20 | 20 | * The option's key. |
| 21 | 21 | */ |
| 22 | - const TOKEN_OPTION = 'semrush_tokens'; | |
| 22 | + public const TOKEN_OPTION = 'semrush_tokens'; | |
| 23 | 23 | |
| 24 | 24 | /** |
| 25 | 25 | * SEMrush_Client constructor. |
| 26 | 26 | * |
| @@ -28,12 +28,9 @@ | ||
| 28 | 28 | * @param WP_Remote_Handler $wp_remote_handler The request handler. |
| 29 | 29 | * |
| 30 | 30 | * @throws Empty_Property_Exception Throws when one of the required properties is empty. |
| 31 | 31 | */ |
| 32 | - public function __construct( | |
| 33 | - Options_Helper $options_helper, | |
| 34 | - WP_Remote_Handler $wp_remote_handler | |
| 35 | - ) { | |
| 32 | + public function __construct( Options_Helper $options_helper, WP_Remote_Handler $wp_remote_handler ) { | |
| 36 | 33 | $provider = new GenericProvider( |
| 37 | 34 | [ |
| 38 | 35 | 'clientId' => 'yoast', |
| 39 | 36 | 'clientSecret' => 'YdqNsWwnP4vE54WO1ugThKEjGMxMAHJt', |
| @@ -43,15 +40,15 @@ | ||
| 43 | 40 | 'urlResourceOwnerDetails' => 'https://oauth.semrush.com/oauth2/resource', |
| 44 | 41 | ], |
| 45 | 42 | [ |
| 46 | 43 | 'httpClient' => new Client( [ 'handler' => $wp_remote_handler ] ), |
| 47 | - ] | |
| 44 | + ], | |
| 48 | 45 | ); |
| 49 | 46 | |
| 50 | 47 | parent::__construct( |
| 51 | 48 | self::TOKEN_OPTION, |
| 52 | 49 | $provider, |
| 53 | - $options_helper | |
| 50 | + $options_helper, | |
| 54 | 51 | ); |
| 55 | 52 | } |
| 56 | 53 | |
| 57 | 54 | /** |
| @@ -77,9 +74,9 @@ | ||
| 77 | 74 | [ |
| 78 | 75 | 'params' => [ |
| 79 | 76 | 'access_token' => $this->get_tokens()->access_token, |
| 80 | 77 | ], |
| 81 | - ] | |
| 78 | + ], | |
| 82 | 79 | ); |
| 83 | 80 | |
| 84 | 81 | return parent::do_request( $method, $url, $options ); |
| 85 | 82 | } |