1 | <?php |
||
20 | class GuzzleAdapter implements HttpClientInterface |
||
21 | { |
||
22 | /** |
||
23 | * @var GuzzleClientInterface |
||
24 | */ |
||
25 | protected $client; |
||
26 | |||
27 | /** |
||
28 | * GuzzleAdapter constructor. |
||
29 | * |
||
30 | * @param GuzzleClientInterface $client |
||
31 | */ |
||
32 | 3 | public function __construct(GuzzleClientInterface $client) |
|
36 | |||
37 | /** |
||
38 | * {@inheritdoc} |
||
39 | */ |
||
40 | 3 | public function request(RequestInterface $request): ResponseInterface |
|
49 | |||
50 | /** |
||
51 | * Create HTTP-Client RequestException by a Guzzle exception |
||
52 | * |
||
53 | * @param GuzzleRequestException $exception |
||
54 | * @return RequestException |
||
55 | */ |
||
56 | 2 | protected function createException(GuzzleRequestException $exception): RequestException |
|
71 | } |
Unless you are absolutely sure that the expression can never be null because of other conditions, we strongly recommend to add an additional type check to your code: