1 | <?php |
||
26 | class CurlMultiClient implements LoggerAwareInterface{ |
||
27 | use LoggerAwareTrait; |
||
28 | |||
29 | /** @var \chillerlan\HTTP\HTTPOptions */ |
||
30 | protected $options; |
||
31 | |||
32 | /** @var \Psr\Http\Message\ResponseFactoryInterface */ |
||
33 | protected $responseFactory; |
||
34 | |||
35 | /** @var \chillerlan\HTTP\CurlUtils\MultiResponseHandlerInterface */ |
||
36 | protected $multiResponseHandler; |
||
37 | |||
38 | /** |
||
39 | * the curl_multi master handle |
||
40 | * |
||
41 | * @var resource |
||
42 | */ |
||
43 | protected $curl_multi; |
||
44 | |||
45 | /** |
||
46 | * An array of RequestInterface to run |
||
47 | * |
||
48 | * @var \Psr\Http\Message\RequestInterface[] |
||
49 | */ |
||
50 | protected $requests = []; |
||
51 | |||
52 | /** |
||
53 | * the stack of running handles |
||
54 | * |
||
55 | * @var \chillerlan\HTTP\CurlUtils\CurlHandle[] |
||
56 | */ |
||
57 | protected $handles = []; |
||
58 | |||
59 | /** |
||
60 | * @var int |
||
61 | */ |
||
62 | protected $handleCounter = 0; |
||
63 | |||
64 | /** |
||
65 | * CurlMultiClient constructor. |
||
66 | * |
||
67 | * @param \chillerlan\Settings\SettingsContainerInterface|null $options |
||
68 | * @param \Psr\Http\Message\ResponseFactoryInterface|null $responseFactory |
||
69 | * @param \Psr\Log\LoggerInterface|null $logger |
||
70 | */ |
||
71 | public function __construct( |
||
89 | |||
90 | /** |
||
91 | * close an existing cURL multi handle on exit |
||
92 | */ |
||
93 | public function __destruct(){ |
||
96 | |||
97 | /** |
||
98 | * @return void |
||
99 | */ |
||
100 | public function close():void{ |
||
107 | |||
108 | /** |
||
109 | * @param \chillerlan\HTTP\CurlUtils\MultiResponseHandlerInterface $handler |
||
110 | * |
||
111 | * @return \chillerlan\HTTP\CurlUtils\CurlMultiClient |
||
112 | */ |
||
113 | public function setMultiResponseHandler(MultiResponseHandlerInterface $handler):CurlMultiClient{ |
||
118 | |||
119 | /** |
||
120 | * @param \Psr\Http\Message\RequestInterface $request |
||
121 | * |
||
122 | * @return \chillerlan\HTTP\CurlUtils\CurlMultiClient |
||
123 | */ |
||
124 | public function addRequest(RequestInterface $request):CurlMultiClient{ |
||
129 | |||
130 | /** |
||
131 | * @param \Psr\Http\Message\RequestInterface[] $stack |
||
132 | * |
||
133 | * @return \chillerlan\HTTP\CurlUtils\CurlMultiClient |
||
134 | */ |
||
135 | public function addRequests(iterable $stack):CurlMultiClient{ |
||
147 | |||
148 | /** |
||
149 | * @throws \chillerlan\HTTP\Psr18\ClientException |
||
150 | */ |
||
151 | public function process():CurlMultiClient{ |
||
198 | |||
199 | /** |
||
200 | * @param \Psr\Http\Message\RequestInterface $request |
||
201 | * @param int|null $id |
||
202 | * @param int|null $retries |
||
203 | * |
||
204 | * @return void |
||
205 | */ |
||
206 | protected function createHandle(RequestInterface $request = null, int $id = null, int $retries = null):void{ |
||
232 | |||
233 | } |
||
234 |
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.