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 | * @param bool $useJson |
||
56 | * @return array|null |
||
57 | */ |
||
58 | public function post($uri, $params = [], $useJson = false) |
||
64 | |||
65 | /** |
||
66 | * @param string $uri |
||
67 | * @param array $params |
||
68 | * @param bool $useJson |
||
69 | * @return array|null |
||
70 | */ |
||
71 | public function put($uri, $params = [], $useJson = false) |
||
77 | |||
78 | /** |
||
79 | * @param string $uri |
||
80 | * @param null $headers |
||
81 | * @return array|null |
||
82 | */ |
||
83 | public function delete($uri, $headers = null) |
||
87 | |||
88 | /** |
||
89 | * @param Response $response |
||
90 | * @return array|null |
||
91 | */ |
||
92 | private function parseResponse(Response $response) |
||
96 | |||
97 | /** |
||
98 | * @param string $method |
||
99 | * @param string $uri |
||
100 | * @param array $options |
||
101 | * @return array|null |
||
102 | */ |
||
103 | protected function executeRequest($method, $uri, array $options = []) |
||
111 | |||
112 | /** |
||
113 | * @param array $params |
||
114 | * @param $json |
||
115 | * @return array |
||
116 | */ |
||
117 | protected function makeOptions(array $params = [], $json) |
||
123 | } |
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.