From 62bd235af744a6ca2965cc6fb276f4b89d5d8b8d Mon Sep 17 00:00:00 2001 From: Oleksandr Mykhailenko Date: Sat, 27 Aug 2022 18:39:53 +0300 Subject: [PATCH] Correct config file (#837) Test Test Test Test Test Test Test Ignore errors Ignore errors Ignore errors Webhook is still using ClientInterface type declaration #783 --- roave-bc-check.yaml | 4 ++++ src/Api/HttpApi.php | 13 ++++++------- src/Api/Suppression.php | 7 ++++++- src/Api/Webhook.php | 8 +++++++- 4 files changed, 23 insertions(+), 9 deletions(-) create mode 100644 roave-bc-check.yaml diff --git a/roave-bc-check.yaml b/roave-bc-check.yaml new file mode 100644 index 0000000..d6502eb --- /dev/null +++ b/roave-bc-check.yaml @@ -0,0 +1,4 @@ +parameters: + ignoreErrors: + - '#Mailgun\\Api\\Webhook#' + - '#Mailgun\\Api\\Suppression#' diff --git a/src/Api/HttpApi.php b/src/Api/HttpApi.php index c79ad92..44233d0 100644 --- a/src/Api/HttpApi.php +++ b/src/Api/HttpApi.php @@ -11,7 +11,6 @@ declare(strict_types=1); namespace Mailgun\Api; -use Http\Client\Common\PluginClient; use Mailgun\Exception\HttpClientException; use Mailgun\Exception\HttpServerException; use Mailgun\Exception\UnknownErrorException; @@ -31,7 +30,7 @@ abstract class HttpApi /** * The HTTP client. * - * @var ClientInterface|PluginClient + * @var ClientInterface */ protected $httpClient; @@ -45,13 +44,13 @@ abstract class HttpApi */ protected $requestBuilder; + /** + * @param ClientInterface $httpClient + * @param RequestBuilder $requestBuilder + * @param Hydrator $hydrator + */ public function __construct($httpClient, RequestBuilder $requestBuilder, Hydrator $hydrator) { - if (!is_a($httpClient, ClientInterface::class) && - !is_a($httpClient, PluginClient::class)) { - throw new \RuntimeException('httpClient must be an instance of - Psr\Http\Client\ClientInterface or Http\Client\Common\PluginClient'); - } $this->httpClient = $httpClient; $this->requestBuilder = $requestBuilder; if (!$hydrator instanceof NoopHydrator) { diff --git a/src/Api/Suppression.php b/src/Api/Suppression.php index 550a46c..968ce66 100644 --- a/src/Api/Suppression.php +++ b/src/Api/Suppression.php @@ -41,7 +41,12 @@ class Suppression */ private $hydrator; - public function __construct(ClientInterface $httpClient, RequestBuilder $requestBuilder, Hydrator $hydrator) + /** + * @param ClientInterface $httpClient + * @param RequestBuilder $requestBuilder + * @param Hydrator $hydrator + */ + public function __construct($httpClient, RequestBuilder $requestBuilder, Hydrator $hydrator) { $this->httpClient = $httpClient; $this->requestBuilder = $requestBuilder; diff --git a/src/Api/Webhook.php b/src/Api/Webhook.php index 9c2565b..7d52af8 100644 --- a/src/Api/Webhook.php +++ b/src/Api/Webhook.php @@ -34,7 +34,13 @@ class Webhook extends HttpApi */ private $apiKey; - public function __construct(ClientInterface $httpClient, RequestBuilder $requestBuilder, Hydrator $hydrator, string $apiKey) + /** + * @param ClientInterface $httpClient + * @param RequestBuilder $requestBuilder + * @param Hydrator $hydrator + * @param string $apiKey + */ + public function __construct($httpClient, RequestBuilder $requestBuilder, Hydrator $hydrator, string $apiKey) { parent::__construct($httpClient, $requestBuilder, $hydrator); $this->apiKey = $apiKey;