mirror of
https://github.com/retailcrm/mailgun-php.git
synced 2025-02-18 05:43:15 +03:00
* HttpApi: Expect client to be of type ClientInterface|PluginClient * Format with pretty * pretty-fix run on the whole repo * User is_a instead of instance_of for php-stan * Use the namespaced classname in instanceof checks * Fix param documentation for MessageBuilder::parseAddress * Use ClassName::class approach in is_a
This commit is contained in:
parent
6e372e1e33
commit
1fd018d61c
@ -11,6 +11,7 @@ declare(strict_types=1);
|
||||
|
||||
namespace Mailgun\Api;
|
||||
|
||||
use Http\Client\Common\PluginClient;
|
||||
use Mailgun\Exception\HttpClientException;
|
||||
use Mailgun\Exception\HttpServerException;
|
||||
use Mailgun\Exception\UnknownErrorException;
|
||||
@ -29,7 +30,7 @@ abstract class HttpApi
|
||||
/**
|
||||
* The HTTP client.
|
||||
*
|
||||
* @var ClientInterface
|
||||
* @var ClientInterface|PluginClient
|
||||
*/
|
||||
protected $httpClient;
|
||||
|
||||
@ -43,8 +44,13 @@ abstract class HttpApi
|
||||
*/
|
||||
protected $requestBuilder;
|
||||
|
||||
public function __construct(ClientInterface $httpClient, RequestBuilder $requestBuilder, 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) {
|
||||
|
@ -84,6 +84,8 @@ class MessageBuilder
|
||||
}
|
||||
|
||||
/**
|
||||
* @param array $variables {
|
||||
*
|
||||
* @var string
|
||||
* @var string
|
||||
* @var string
|
||||
|
Loading…
x
Reference in New Issue
Block a user