1 | <?php |
||
22 | class MultiRequest{ |
||
23 | |||
24 | /** |
||
25 | * the curl_multi master handle |
||
26 | * |
||
27 | * @var resource |
||
28 | */ |
||
29 | protected $curl_multi; |
||
30 | |||
31 | /** |
||
32 | * cURL options for each handle |
||
33 | * |
||
34 | * @var array |
||
35 | */ |
||
36 | protected $curl_options = []; |
||
37 | |||
38 | /** |
||
39 | * An array of the request URLs as \chillerlan\TinyCurl\URL object |
||
40 | * |
||
41 | * @var array |
||
42 | */ |
||
43 | protected $stack = []; |
||
44 | |||
45 | /** |
||
46 | * The returned value from MultiResponseHandlerInterface::handleResponse() for each request |
||
47 | * |
||
48 | * @var array |
||
49 | */ |
||
50 | protected $responses = []; |
||
51 | |||
52 | /** |
||
53 | * @var \chillerlan\TinyCurl\MultiRequestOptions |
||
54 | */ |
||
55 | protected $options; |
||
56 | |||
57 | /** |
||
58 | * @var \chillerlan\TinyCurl\Response\MultiResponseHandlerInterface |
||
59 | */ |
||
60 | protected $multiResponseHandler; |
||
61 | |||
62 | /** |
||
63 | * MultiRequest constructor. |
||
64 | * |
||
65 | * @param \chillerlan\TinyCurl\MultiRequestOptions $options |
||
|
|||
66 | */ |
||
67 | public function __construct(MultiRequestOptions $options = null){ |
||
89 | |||
90 | /** |
||
91 | * closes the curl_multi instance |
||
92 | * |
||
93 | * @codeCoverageIgnore |
||
94 | */ |
||
95 | public function __destruct(){ |
||
100 | |||
101 | /** |
||
102 | * @param \chillerlan\TinyCurl\Response\MultiResponseHandlerInterface $handler |
||
103 | * |
||
104 | * @return $this |
||
105 | * @throws \chillerlan\TinyCurl\RequestException |
||
106 | */ |
||
107 | public function setHandler(MultiResponseHandlerInterface $handler = null){ |
||
127 | |||
128 | /** |
||
129 | * @param array $urls array of \chillerlan\TinyCurl\URL objects |
||
130 | * |
||
131 | * @return $this |
||
132 | * @throws \chillerlan\TinyCurl\RequestException |
||
133 | */ |
||
134 | public function fetch(array $urls){ |
||
157 | |||
158 | /** |
||
159 | * @param mixed $response |
||
160 | * |
||
161 | * @see \chillerlan\TinyCurl\Response\MultiResponseHandlerInterface |
||
162 | * @return $this |
||
163 | */ |
||
164 | public function addResponse($response){ |
||
169 | |||
170 | /** |
||
171 | * @return array |
||
172 | */ |
||
173 | public function getResponseData(){ |
||
176 | |||
177 | /** |
||
178 | * creates a new cURL handle |
||
179 | */ |
||
180 | protected function createHandle(){ |
||
198 | |||
199 | /** |
||
200 | * processes the requests |
||
201 | */ |
||
202 | protected function processStack(){ |
||
230 | |||
231 | } |
||
232 |
This check looks for
@param
annotations where the type inferred by our type inference engine differs from the declared type.It makes a suggestion as to what type it considers more descriptive.
Most often this is a case of a parameter that can be null in addition to its declared types.