1 | <?php |
||
15 | abstract class Collection implements \Countable, \Iterator, \ArrayAccess |
||
16 | { |
||
17 | /** @var array */ |
||
18 | private $elements; |
||
19 | |||
20 | /** |
||
21 | * Collection constructor. |
||
22 | * @param array $elements |
||
23 | */ |
||
24 | public function __construct(array $elements) |
||
34 | |||
35 | /** |
||
36 | * @param $element |
||
37 | */ |
||
38 | public function add($element) |
||
46 | |||
47 | /** |
||
48 | * @param $key |
||
49 | * @param $element |
||
50 | */ |
||
51 | public function set($key, $element) |
||
59 | |||
60 | /** |
||
61 | * @param $element |
||
62 | * @return bool |
||
63 | */ |
||
64 | public function isValid($element): bool |
||
68 | |||
69 | /** |
||
70 | * @return bool |
||
71 | */ |
||
72 | public function isEmpty(): bool |
||
76 | |||
77 | /** |
||
78 | * @return array |
||
79 | */ |
||
80 | public function keys() |
||
84 | |||
85 | /** |
||
86 | * @return array |
||
87 | */ |
||
88 | public function values() |
||
92 | |||
93 | /** |
||
94 | * @return mixed |
||
95 | */ |
||
96 | public function first() |
||
100 | |||
101 | /** |
||
102 | * @return mixed |
||
103 | */ |
||
104 | public function last() |
||
108 | |||
109 | /** |
||
110 | * @return mixed |
||
111 | */ |
||
112 | public function current() |
||
116 | |||
117 | public function next() |
||
121 | |||
122 | /** |
||
123 | * @return mixed |
||
124 | */ |
||
125 | public function key() |
||
129 | |||
130 | /** |
||
131 | * @return bool |
||
132 | */ |
||
133 | public function valid(): bool |
||
137 | |||
138 | public function rewind() |
||
142 | |||
143 | /** |
||
144 | * @param mixed $offset |
||
145 | * @return bool |
||
146 | */ |
||
147 | public function offsetExists($offset) |
||
151 | |||
152 | /** |
||
153 | * @param mixed $offset |
||
154 | * @return mixed|null |
||
155 | */ |
||
156 | public function offsetGet($offset) |
||
160 | |||
161 | /** |
||
162 | * @param mixed $offset |
||
163 | * @param mixed $value |
||
164 | */ |
||
165 | public function offsetSet($offset, $value) |
||
173 | |||
174 | /** |
||
175 | * @param mixed $offset |
||
176 | */ |
||
177 | public function offsetUnset($offset) |
||
181 | |||
182 | /** |
||
183 | * @return int |
||
184 | */ |
||
185 | public function count(): int |
||
189 | } |
||
190 |
This check looks from parameters that have been defined for a function or method, but which are not used in the method body.