1 | <?php declare(strict_types = 1); |
||
32 | final class PaginatedResponse implements IteratorAggregate, ArrayAccess |
||
33 | { |
||
34 | /** |
||
35 | * @var Client |
||
36 | */ |
||
37 | private $client; |
||
38 | |||
39 | /** |
||
40 | * @var array |
||
41 | */ |
||
42 | private $list; |
||
43 | |||
44 | /** |
||
45 | * @var array |
||
46 | */ |
||
47 | private $pagination; |
||
48 | |||
49 | /** |
||
50 | * @param Client $client |
||
51 | */ |
||
52 | public function __construct(Client $client, array $body) |
||
59 | |||
60 | /** |
||
61 | * @param array $body |
||
62 | * @return void |
||
63 | */ |
||
64 | private function guardAndSetResponseBody(array $body) |
||
71 | |||
72 | /** |
||
73 | * @param array $body |
||
74 | * @return void |
||
75 | */ |
||
76 | private function guardAndSetPagination(array $body) |
||
99 | |||
100 | /** |
||
101 | * Retrieve an external iterator |
||
102 | * @link http://php.net/manual/en/iteratoraggregate.getiterator.php |
||
103 | * @return Traversable An instance of an object implementing <b>Iterator</b> or |
||
104 | * <b>Traversable</b> |
||
105 | * @since 5.0.0 |
||
106 | */ |
||
107 | public function getIterator() |
||
121 | |||
122 | /** |
||
123 | * Whether a offset exists |
||
124 | * @link http://php.net/manual/en/arrayaccess.offsetexists.php |
||
125 | * @param mixed $offset <p> |
||
126 | * An offset to check for. |
||
127 | * </p> |
||
128 | * @return boolean true on success or false on failure. |
||
129 | * </p> |
||
130 | * <p> |
||
131 | * The return value will be casted to boolean if non-boolean was returned. |
||
132 | * @since 5.0.0 |
||
133 | */ |
||
134 | public function offsetExists($offset) |
||
138 | |||
139 | /** |
||
140 | * Offset to retrieve |
||
141 | * @link http://php.net/manual/en/arrayaccess.offsetget.php |
||
142 | * @param mixed $offset <p> |
||
143 | * The offset to retrieve. |
||
144 | * </p> |
||
145 | * @return mixed Can return all value types. |
||
146 | * @since 5.0.0 |
||
147 | */ |
||
148 | public function offsetGet($offset) |
||
153 | |||
154 | /** |
||
155 | * Offset to set |
||
156 | * @link http://php.net/manual/en/arrayaccess.offsetset.php |
||
157 | * @param mixed $offset <p> |
||
158 | * The offset to assign the value to. |
||
159 | * </p> |
||
160 | * @param mixed $value <p> |
||
161 | * The value to set. |
||
162 | * </p> |
||
163 | * @return void |
||
164 | * @since 5.0.0 |
||
165 | */ |
||
166 | public function offsetSet($offset, $value) |
||
170 | |||
171 | /** |
||
172 | * Offset to unset |
||
173 | * @link http://php.net/manual/en/arrayaccess.offsetunset.php |
||
174 | * @param mixed $offset <p> |
||
175 | * The offset to unset. |
||
176 | * </p> |
||
177 | * @return void |
||
178 | * @since 5.0.0 |
||
179 | */ |
||
180 | public function offsetUnset($offset) |
||
184 | } |
||
185 |