1 | <?php |
||
10 | class GuzzleHttpAdapter implements HttpInterface |
||
11 | { |
||
12 | /** |
||
13 | * @var Client |
||
14 | */ |
||
15 | protected $client; |
||
16 | |||
17 | /** |
||
18 | * @var |
||
19 | */ |
||
20 | protected $headers; |
||
21 | |||
22 | public function __construct($baseUrl) |
||
26 | |||
27 | /** |
||
28 | * @param mixed $headers |
||
29 | * @return GuzzleHttpAdapter |
||
30 | */ |
||
31 | public function setHeaders($headers) |
||
37 | |||
38 | /** |
||
39 | * @param string $uri |
||
40 | * @param array $params |
||
41 | * @return array|null |
||
42 | */ |
||
43 | public function get($uri, $params = []) |
||
51 | |||
52 | /** |
||
53 | * @param string $uri |
||
54 | * @param array $params |
||
55 | * @return array|null |
||
56 | */ |
||
57 | public function post($uri, $params = []) |
||
63 | |||
64 | /** |
||
65 | * @param string $uri |
||
66 | * @param array $params |
||
67 | * @return array|null |
||
68 | */ |
||
69 | public function postJson($uri, $params = []) |
||
75 | |||
76 | /** |
||
77 | * @param string $uri |
||
78 | * @param array $params |
||
79 | * @return array|null |
||
80 | */ |
||
81 | public function put($uri, $params = []) |
||
87 | |||
88 | /** |
||
89 | * @param string $uri |
||
90 | * @param array $params |
||
91 | * @return array|null |
||
92 | */ |
||
93 | public function putJson($uri, $params = []) |
||
99 | |||
100 | /** |
||
101 | * @param string $uri |
||
102 | * @param null $headers |
||
103 | * @return array|null |
||
104 | */ |
||
105 | public function delete($uri, $headers = null) |
||
109 | |||
110 | /** |
||
111 | * @param Response $response |
||
112 | * @return array|null |
||
113 | */ |
||
114 | private function parseResponse(Response $response) |
||
118 | |||
119 | /** |
||
120 | * @param string $method |
||
121 | * @param string $uri |
||
122 | * @param array $options |
||
123 | * @return array|null |
||
124 | */ |
||
125 | protected function executeRequest($method, $uri, array $options = []) |
||
133 | } |
This check looks for parameters that are defined as one type in their type hint or doc comment but seem to be used as a narrower type, i.e an implementation of an interface or a subclass.
Consider changing the type of the parameter or doing an instanceof check before assuming your parameter is of the expected type.