1 | <?php |
||
16 | class CharCollection extends AbstractCollection |
||
17 | { |
||
18 | /** |
||
19 | * Convert input data to an array. |
||
20 | * |
||
21 | * Convert the input data to an array that can be worked with by a collection. |
||
22 | * |
||
23 | * @param mixed $data The input data |
||
24 | * @return array |
||
25 | */ |
||
26 | 25 | protected function prepareData($data) |
|
33 | |||
34 | /** |
||
35 | * Apply a callback to each item in collection. |
||
36 | * |
||
37 | * Applies a callback to each item in collection and returns a new collection |
||
38 | * containing each iteration's return value. |
||
39 | * |
||
40 | * @param callable $callback The callback to apply |
||
41 | * @return AbstractCollection A new collection with callback return values |
||
42 | */ |
||
43 | 2 | public function map(callable $callback) |
|
47 | |||
48 | /** |
||
49 | * @inheritdoc |
||
50 | */ |
||
51 | 1 | public function push(...$items) |
|
56 | |||
57 | /** |
||
58 | * @inheritdoc |
||
59 | */ |
||
60 | 1 | public function unshift(...$items) |
|
65 | |||
66 | |||
67 | /** |
||
68 | * Is data consistent with this collection type? |
||
69 | * |
||
70 | * @param mixed $data The data to check |
||
71 | * @return bool |
||
72 | */ |
||
73 | 25 | protected function isConsistentDataStructure($data) |
|
77 | |||
78 | } |