1 | <?php |
||
14 | final class AggregateResponse implements \IteratorAggregate |
||
15 | { |
||
16 | /** |
||
17 | * @var array|ResponseInterface[] |
||
18 | */ |
||
19 | private $lines = []; |
||
20 | |||
21 | /** |
||
22 | * @var RequestInterface |
||
23 | */ |
||
24 | private $request; |
||
25 | |||
26 | /** |
||
27 | * Reply constructor. |
||
28 | * @param RequestInterface $request |
||
29 | */ |
||
30 | public function __construct(RequestInterface $request) |
||
34 | |||
35 | /** |
||
36 | * @return \Iterator|ResponseInterface[] |
||
37 | */ |
||
38 | public function getIterator(): \Iterator |
||
42 | |||
43 | /** |
||
44 | * @return ResponseInterface |
||
45 | */ |
||
46 | public function first(): ResponseInterface |
||
54 | |||
55 | /** |
||
56 | * @return ResponseInterface |
||
57 | */ |
||
58 | public function last(): ResponseInterface |
||
66 | |||
67 | /** |
||
68 | * @param int $index |
||
69 | * @return ResponseInterface |
||
70 | */ |
||
71 | public function at(int $index): ResponseInterface |
||
79 | |||
80 | /** |
||
81 | * @return bool |
||
82 | */ |
||
83 | public function hasCompleted(): bool |
||
104 | |||
105 | /** |
||
106 | * @param string $line |
||
107 | * @return AggregateResponse |
||
108 | */ |
||
109 | public function withLine(string $line): AggregateResponse |
||
143 | } |
||
144 |