From 2550abb7255e043b7ab8022e96f206c665309b1d Mon Sep 17 00:00:00 2001 From: Joshua Bours Date: Tue, 4 Jun 2024 11:08:38 +0200 Subject: [PATCH 1/2] fixed Picqer\BolRetailerV10\BaseClient::Picqer\BolRetailerV10\{closure}(): Argument #4 ($exception) must be of type ?GuzzleHttp\Exception\RequestException, GuzzleHttp\Exception\ConnectException given, called in /application/vendor/guzzlehttp/guzzle/src/RetryMiddleware.php on line 100 --- src/BaseClient.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/BaseClient.php b/src/BaseClient.php index 5b764a2..f26d7dc 100644 --- a/src/BaseClient.php +++ b/src/BaseClient.php @@ -4,6 +4,7 @@ use GuzzleHttp\Client as HttpClient; use GuzzleHttp\Exception\BadResponseException; +use GuzzleHttp\Exception\ClientException; use GuzzleHttp\Exception\GuzzleException; use GuzzleHttp\Exception\ConnectException as GuzzleConnectException; use GuzzleHttp\Exception\RequestException; @@ -607,7 +608,7 @@ private function retryDecider() $retries, RequestInterface $request, ?ResponseInterface $response = null, - ?RequestException $exception = null + RequestException|ClientException|null $exception = null ) { return $this->respectRateLimits && $response From ad9e05efc804566c60b064fb4a56f5536ad17ade Mon Sep 17 00:00:00 2001 From: Joshua Bours Date: Mon, 5 Aug 2024 12:23:10 +0200 Subject: [PATCH 2/2] as suggested now using ClientExceptionInterface as type for $exception param --- src/BaseClient.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/BaseClient.php b/src/BaseClient.php index f26d7dc..47cb0fb 100644 --- a/src/BaseClient.php +++ b/src/BaseClient.php @@ -19,6 +19,7 @@ use Picqer\BolRetailerV10\Exception\UnauthorizedException; use Picqer\BolRetailerV10\Model\Authentication\TokenResponse; use Picqer\BolRetailerV10\Model\Authentication\TokenRequest; +use Psr\Http\Client\ClientExceptionInterface; use Psr\Http\Message\RequestInterface; use Psr\Http\Message\ResponseInterface; @@ -608,7 +609,7 @@ private function retryDecider() $retries, RequestInterface $request, ?ResponseInterface $response = null, - RequestException|ClientException|null $exception = null + ?ClientExceptionInterface $exception = null ) { return $this->respectRateLimits && $response