From c5e25f84bd18c830732d6b02d28f9d734e13505e Mon Sep 17 00:00:00 2001 From: Alexander Kamp Date: Thu, 4 Jun 2020 21:35:23 +0200 Subject: [PATCH 1/2] Found few small issues while reviewing using phpStorm Added Composer extension requirements (json, curl) Client: magic method 'unsubcribes' -> 'unsubscribes' Exception throw blocks Typos --- composer.json | 4 +++- lib/Client.php | 6 ++++-- lib/Exception/InvalidRequest.php | 2 +- 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/composer.json b/composer.json index 6453a48..146d016 100644 --- a/composer.json +++ b/composer.json @@ -16,7 +16,9 @@ } ], "require": { - "php": ">=5.6" + "php": ">=5.6", + "ext-curl": "*", + "ext-json": "*" }, "require-dev": { "phpunit/phpunit": "~4.4", diff --git a/lib/Client.php b/lib/Client.php index 4b34b5b..8324e89 100644 --- a/lib/Client.php +++ b/lib/Client.php @@ -123,14 +123,14 @@ * @method Client subusers() * @method Client reputations() * - * Supressions + * Suppressions * @method Client suppression() * @method Client global() * @method Client blocks() * @method Client bounces() * @method Client invalid_emails() * @method Client spam_reports() - * @method Client unsubcribes() + * @method Client unsubscribes() * * Templates * @method Client templates() @@ -432,6 +432,7 @@ private function parseResponse($channel, $content) * @param array $headers original headers * * @return Response response object + * @throws InvalidRequest */ private function retryRequest(array $responseHeaders, $method, $url, $body, $headers) { @@ -562,6 +563,7 @@ public function _($name = null) * @param array $args parameters passed with the method call * * @return Client|Response|Response[]|null object + * @throws InvalidRequest */ public function __call($name, $args) { diff --git a/lib/Exception/InvalidRequest.php b/lib/Exception/InvalidRequest.php index 542c114..787ad23 100644 --- a/lib/Exception/InvalidRequest.php +++ b/lib/Exception/InvalidRequest.php @@ -12,7 +12,7 @@ * * Thrown when invalid payload was constructed, which could not reach SendGrid server. * - * @package SendGrid\Exceptions + * @package SendGrid\Exception */ class InvalidRequest extends \Exception { From eb1a4c9f79adda0cb0e28905b9b5e26c9374fed7 Mon Sep 17 00:00:00 2001 From: Alexander Kamp Date: Wed, 10 Jun 2020 08:52:55 +0200 Subject: [PATCH 2/2] Client: Added PHPDoc definition for 4th argument for magic methods get, post, patch, put and delete --- lib/Client.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/lib/Client.php b/lib/Client.php index 8324e89..2609a39 100644 --- a/lib/Client.php +++ b/lib/Client.php @@ -16,11 +16,11 @@ * * Quickly and easily access any REST or REST-like API. * - * @method Response get($body = null, $query = null, $headers = null) - * @method Response post($body = null, $query = null, $headers = null) - * @method Response patch($body = null, $query = null, $headers = null) - * @method Response put($body = null, $query = null, $headers = null) - * @method Response delete($body = null, $query = null, $headers = null) + * @method Response get($body = null, $query = null, $headers = null, $retryOnLimit = null) + * @method Response post($body = null, $query = null, $headers = null, $retryOnLimit = null) + * @method Response patch($body = null, $query = null, $headers = null, $retryOnLimit = null) + * @method Response put($body = null, $query = null, $headers = null, $retryOnLimit = null) + * @method Response delete($body = null, $query = null, $headers = null, $retryOnLimit = null) * * @method Client version($value) * @method Client|Response send()