1 | <?php |
||
20 | class CurlClient implements HTTPClientInterface{ |
||
21 | |||
22 | /** |
||
23 | * @var \chillerlan\HTTP\HTTPOptions |
||
24 | */ |
||
25 | protected $options; |
||
26 | |||
27 | /** |
||
28 | * @var \Psr\Http\Message\RequestFactoryInterface |
||
29 | */ |
||
30 | protected $requestFactory; |
||
31 | |||
32 | /** |
||
33 | * @var \Psr\Http\Message\ResponseFactoryInterface |
||
34 | */ |
||
35 | protected $responseFactory; |
||
36 | |||
37 | /** |
||
38 | * @var \Psr\Http\Message\StreamFactoryInterface |
||
39 | */ |
||
40 | protected $streamFactory; |
||
41 | |||
42 | /** |
||
43 | * CurlClient constructor. |
||
44 | * |
||
45 | * @param \chillerlan\Settings\SettingsContainerInterface|null $options |
||
46 | * @param \Psr\Http\Message\RequestFactoryInterface|null $requestFactory |
||
47 | * @param \Psr\Http\Message\ResponseFactoryInterface|null $responseFactory |
||
48 | * @param \Psr\Http\Message\StreamFactoryInterface|null $streamFactory |
||
49 | */ |
||
50 | public function __construct( |
||
61 | |||
62 | /** |
||
63 | * Sends a PSR-7 request. |
||
64 | * |
||
65 | * @param \Psr\Http\Message\RequestInterface $request |
||
66 | * |
||
67 | * @return \Psr\Http\Message\ResponseInterface |
||
68 | * |
||
69 | * @throws \Http\Client\Exception If an error happens during processing the request. |
||
70 | * @throws \Exception If processing the request is impossible (eg. bad configuration). |
||
71 | */ |
||
72 | public function sendRequest(RequestInterface $request):ResponseInterface{ |
||
105 | |||
106 | /** |
||
107 | * @todo: files, content-type |
||
108 | * |
||
109 | * @param string $uri |
||
110 | * @param string|null $method |
||
111 | * @param array|null $query |
||
112 | * @param mixed|null $body |
||
113 | * @param array|null $headers |
||
114 | * |
||
115 | * @return \Psr\Http\Message\ResponseInterface |
||
116 | */ |
||
117 | public function request(string $uri, string $method = null, array $query = null, $body = null, array $headers = null):ResponseInterface{ |
||
148 | |||
149 | } |
||
150 |
Our type inference engine has found a suspicous assignment of a value to a property. This check raises an issue when a value that can be of a given class or a super-class is assigned to a property that is type hinted more strictly.
Either this assignment is in error or an instanceof check should be added for that assignment.