1 | <?php |
||
26 | class ArrayCollection implements \IteratorAggregate, \Countable, \ArrayAccess |
||
27 | { |
||
28 | /** |
||
29 | * @var array<int|string, mixed> |
||
30 | * @phpstan-var array<TKey, TValue> |
||
31 | */ |
||
32 | private $elements; |
||
33 | |||
34 | /** |
||
35 | * Constructor |
||
36 | * |
||
37 | * @param array<int|string, mixed> $elements |
||
38 | * |
||
39 | * @phpstan-param array<TKey, TValue> $elements |
||
40 | */ |
||
41 | 3123 | public function __construct(array $elements = []) |
|
49 | |||
50 | /** |
||
51 | * @return mixed|false |
||
52 | * |
||
53 | * @phpstan-return TValue|false |
||
54 | */ |
||
55 | 120 | public function first() |
|
59 | |||
60 | /** |
||
61 | * @return mixed|false |
||
62 | * |
||
63 | * @phpstan-return TValue|false |
||
64 | */ |
||
65 | 3 | public function last() |
|
69 | |||
70 | /** |
||
71 | * Retrieve an external iterator |
||
72 | * |
||
73 | * @return \ArrayIterator<int|string, mixed> |
||
|
|||
74 | * |
||
75 | * @phpstan-return \ArrayIterator<TKey, TValue> |
||
76 | */ |
||
77 | 3 | public function getIterator() |
|
81 | |||
82 | /** |
||
83 | * @param mixed $element |
||
84 | * |
||
85 | * @return bool |
||
86 | * |
||
87 | * @phpstan-param TValue $element |
||
88 | * |
||
89 | * @deprecated |
||
90 | */ |
||
91 | 6 | public function add($element): bool |
|
99 | |||
100 | /** |
||
101 | * @param int|string $key |
||
102 | * @param mixed $value |
||
103 | * |
||
104 | * @return void |
||
105 | * |
||
106 | * @phpstan-param TKey $key |
||
107 | * @phpstan-param TValue $value |
||
108 | * |
||
109 | * @deprecated |
||
110 | */ |
||
111 | 3 | public function set($key, $value) |
|
117 | |||
118 | /** |
||
119 | * @param int|string $key |
||
120 | * |
||
121 | * @return mixed |
||
122 | * |
||
123 | * @phpstan-param TKey $key |
||
124 | * |
||
125 | * @phpstan-return TValue|null |
||
126 | * |
||
127 | * @deprecated |
||
128 | */ |
||
129 | 3 | public function get($key) |
|
135 | |||
136 | /** |
||
137 | * @param int|string $key |
||
138 | * |
||
139 | * @return mixed |
||
140 | * |
||
141 | * @phpstan-param TKey $key |
||
142 | * |
||
143 | * @phpstan-return TValue|null |
||
144 | * |
||
145 | * @deprecated |
||
146 | */ |
||
147 | 6 | public function remove($key) |
|
160 | |||
161 | /** |
||
162 | * @return bool |
||
163 | * |
||
164 | * @deprecated |
||
165 | */ |
||
166 | 3 | public function isEmpty(): bool |
|
172 | |||
173 | /** |
||
174 | * @param mixed $element |
||
175 | * |
||
176 | * @return bool |
||
177 | * |
||
178 | * @phpstan-param TValue $element |
||
179 | * |
||
180 | * @deprecated |
||
181 | */ |
||
182 | 3 | public function contains($element): bool |
|
188 | |||
189 | /** |
||
190 | * @param mixed $element |
||
191 | * |
||
192 | * @return mixed|false |
||
193 | * |
||
194 | * @phpstan-param TValue $element |
||
195 | * |
||
196 | * @deprecated |
||
197 | */ |
||
198 | 3 | public function indexOf($element) |
|
204 | |||
205 | /** |
||
206 | * @param int|string $key |
||
207 | * |
||
208 | * @return bool |
||
209 | * |
||
210 | * @phpstan-param TKey $key |
||
211 | * |
||
212 | * @deprecated |
||
213 | */ |
||
214 | 3 | public function containsKey($key): bool |
|
220 | |||
221 | /** |
||
222 | * Count elements of an object |
||
223 | * |
||
224 | * @return int The count as an integer. |
||
225 | */ |
||
226 | 120 | public function count(): int |
|
230 | |||
231 | /** |
||
232 | * Whether an offset exists |
||
233 | * |
||
234 | * @param int|string $offset An offset to check for. |
||
235 | * |
||
236 | * @return bool true on success or false on failure. |
||
237 | * |
||
238 | * @phpstan-param TKey $offset |
||
239 | */ |
||
240 | 3 | public function offsetExists($offset): bool |
|
244 | |||
245 | /** |
||
246 | * Offset to retrieve |
||
247 | * |
||
248 | * @param int|string $offset |
||
249 | * |
||
250 | * @return mixed|null |
||
251 | * |
||
252 | * @phpstan-param TKey $offset |
||
253 | * |
||
254 | * @phpstan-return TValue|null |
||
255 | */ |
||
256 | 6 | public function offsetGet($offset) |
|
260 | |||
261 | /** |
||
262 | * Offset to set |
||
263 | * |
||
264 | * @param int|string|null $offset The offset to assign the value to. |
||
265 | * @param mixed $value The value to set. |
||
266 | * |
||
267 | * @return void |
||
268 | * |
||
269 | * @phpstan-param TKey|null $offset |
||
270 | * @phpstan-param TValue $value |
||
271 | */ |
||
272 | 2958 | public function offsetSet($offset, $value) |
|
280 | |||
281 | /** |
||
282 | * Offset to unset |
||
283 | * |
||
284 | * @param int|string $offset The offset to unset. |
||
285 | * |
||
286 | * @return void |
||
287 | * |
||
288 | * @phpstan-param TKey $offset |
||
289 | */ |
||
290 | 6 | public function offsetUnset($offset) |
|
298 | |||
299 | /** |
||
300 | * Returns a subset of the array |
||
301 | * |
||
302 | * @param int $offset |
||
303 | * @param int|null $length |
||
304 | * |
||
305 | * @return array<int|string, mixed> |
||
306 | * |
||
307 | * @phpstan-return array<TKey, TValue> |
||
308 | */ |
||
309 | 108 | public function slice(int $offset, ?int $length = null): array |
|
313 | |||
314 | /** |
||
315 | * @return array<int|string, mixed> |
||
316 | * |
||
317 | * @phpstan-return array<TKey, TValue> |
||
318 | */ |
||
319 | 2820 | public function toArray(): array |
|
323 | |||
324 | /** |
||
325 | * @param array<int|string, mixed> $elements |
||
326 | * |
||
327 | * @return $this |
||
328 | * |
||
329 | * @phpstan-param array<TKey, TValue> $elements |
||
330 | * |
||
331 | * @deprecated |
||
332 | */ |
||
333 | 3 | public function replaceWith(array $elements) |
|
341 | |||
342 | /** |
||
343 | * @deprecated |
||
344 | * |
||
345 | * @return void |
||
346 | */ |
||
347 | 3 | public function removeGaps() |
|
353 | } |
||
354 |
This check marks PHPDoc comments that could not be parsed by our parser. To see which comment annotations we can parse, please refer to our documentation on supported doc-types.