1 | <?php |
||
16 | class Arr extends Collection |
||
17 | { |
||
18 | /** |
||
19 | * @var int Count of elements. |
||
20 | */ |
||
21 | protected $count; |
||
22 | |||
23 | /** |
||
24 | * @var string|callable |
||
25 | */ |
||
26 | protected $until; |
||
27 | |||
28 | /** |
||
29 | * @var array|AbstractField Field to be repeated. |
||
30 | */ |
||
31 | protected $field; |
||
32 | |||
33 | /** |
||
34 | * @var int |
||
35 | */ |
||
36 | protected $index; |
||
37 | |||
38 | 10 | public function __construct($count, $field = [], $options = []) |
|
49 | |||
50 | /** |
||
51 | * Call parse method on arrayed field needed times. |
||
52 | * |
||
53 | * @api |
||
54 | * @param AbstractStream $stream Stream from which children read. |
||
55 | * @return array Array of parsed values. |
||
56 | * @since 1.0 |
||
57 | */ |
||
58 | 5 | public function parse(AbstractStream $stream) |
|
70 | |||
71 | /** |
||
72 | * @return int |
||
73 | */ |
||
74 | 4 | public function getCount() |
|
78 | |||
79 | /** |
||
80 | * @param int $count |
||
81 | * @return $this |
||
82 | */ |
||
83 | 10 | public function setCount($count) |
|
88 | |||
89 | /** |
||
90 | * @return callable|string |
||
91 | */ |
||
92 | 6 | public function getUntil() |
|
96 | |||
97 | /** |
||
98 | * @param callable|string $until |
||
99 | * @return $this |
||
100 | */ |
||
101 | 5 | public function setUntil($until) |
|
106 | |||
107 | /** |
||
108 | * @return AbstractField |
||
|
|||
109 | */ |
||
110 | 5 | public function getField() |
|
118 | |||
119 | /** |
||
120 | * @param array|AbstractField $field |
||
121 | * @return $this |
||
122 | */ |
||
123 | 10 | public function setField($field) |
|
131 | |||
132 | /** |
||
133 | * @inheritdoc |
||
134 | * @return AbstractField |
||
135 | */ |
||
136 | 5 | public function current() |
|
140 | |||
141 | /** |
||
142 | * @inheritdoc |
||
143 | */ |
||
144 | 5 | public function next() |
|
148 | |||
149 | /** |
||
150 | * @inheritdoc |
||
151 | */ |
||
152 | 5 | public function key() |
|
156 | |||
157 | /** |
||
158 | * @inheritdoc |
||
159 | */ |
||
160 | 5 | public function valid() |
|
168 | |||
169 | /** |
||
170 | * @inheritdoc |
||
171 | */ |
||
172 | 5 | public function rewind() |
|
176 | |||
177 | /** |
||
178 | * Whether array must read until end of file. |
||
179 | * |
||
180 | * @return bool |
||
181 | */ |
||
182 | 4 | private function isUntilEof() |
|
187 | } |
This check compares the return type specified in the
@return
annotation of a function or method doc comment with the types returned by the function and raises an issue if they mismatch.