Conditions | 2 |
Paths | 2 |
Total Lines | 18 |
Code Lines | 12 |
Lines | 0 |
Ratio | 0 % |
Tests | 0 |
CRAP Score | 6 |
Changes | 0 |
1 | <?php |
||
35 | $this->promises[] = $this->client->requestAsync($method, $url, [ |
||
36 | 'headers' => $headers |
||
37 | ]); |
||
38 | } |
||
39 | |||
40 | /** |
||
41 | * @return array |
||
42 | * @throws \Exception|\Throwable |
||
43 | */ |
||
44 | public function wait() |
||
45 | { |
||
46 | $phrases = []; |
||
47 | $results = \GuzzleHttp\Promise\settle($this->promises)->wait(); |
||
48 | foreach ($results as $result) { |
||
49 | if ($result['state'] === 'fulfilled') { |
||
50 | $response = $result['value']; |
||
51 | if ($response instanceof Response) { |
||
52 | $phrases[] = [ |
||
53 | 'reason' => $response->getReasonPhrase(), |
||
74 |