1 | <?php |
||
10 | class Cursor implements \Iterator |
||
11 | { |
||
12 | /** |
||
13 | * @var ConnectionCursorInterface |
||
14 | */ |
||
15 | private $connection; |
||
16 | |||
17 | /** |
||
18 | * @var int |
||
19 | */ |
||
20 | private $token; |
||
21 | |||
22 | /** |
||
23 | * @var ResponseInterface |
||
24 | */ |
||
25 | private $response; |
||
26 | |||
27 | /** |
||
28 | * @var int |
||
29 | */ |
||
30 | private $index; |
||
31 | |||
32 | /** |
||
33 | * @var int |
||
34 | */ |
||
35 | private $size; |
||
36 | |||
37 | /** |
||
38 | * @var bool |
||
39 | */ |
||
40 | private $isComplete; |
||
41 | |||
42 | /** |
||
43 | * @var MessageInterface |
||
44 | */ |
||
45 | private $message; |
||
46 | |||
47 | /** |
||
48 | * @param ConnectionCursorInterface $connection |
||
49 | * @param int $token |
||
50 | * @param ResponseInterface $response |
||
51 | * @param MessageInterface $message |
||
52 | */ |
||
53 | 2 | public function __construct(ConnectionCursorInterface $connection, int $token, ResponseInterface $response, MessageInterface $message) |
|
60 | |||
61 | /** |
||
62 | * @param ResponseInterface $response |
||
63 | */ |
||
64 | 2 | private function addResponse(ResponseInterface $response) |
|
71 | |||
72 | /** |
||
73 | * @return void |
||
74 | * @throws \Exception |
||
75 | */ |
||
76 | 2 | private function seek(): void |
|
86 | |||
87 | /** |
||
88 | * @return void |
||
89 | * @throws \Exception |
||
90 | */ |
||
91 | private function request(): void |
||
103 | |||
104 | /** |
||
105 | * @return void |
||
106 | */ |
||
107 | 1 | private function close(): void |
|
118 | |||
119 | /** |
||
120 | * @inheritdoc |
||
121 | * @throws \Exception |
||
122 | */ |
||
123 | 1 | public function current() |
|
131 | |||
132 | /** |
||
133 | * @inheritdoc |
||
134 | * @throws \Exception |
||
135 | */ |
||
136 | 1 | public function next(): void |
|
142 | |||
143 | /** |
||
144 | * @inheritdoc |
||
145 | */ |
||
146 | 1 | public function key(): int |
|
150 | |||
151 | /** |
||
152 | * @inheritdoc |
||
153 | */ |
||
154 | 2 | public function valid(): bool |
|
158 | |||
159 | /** |
||
160 | * @inheritdoc |
||
161 | * @throws ConnectionException |
||
162 | */ |
||
163 | 1 | public function rewind(): void |
|
169 | } |
||
170 |