1 | <?php |
||
15 | trait IterableTrait |
||
16 | { |
||
17 | /** |
||
18 | * Return the current element |
||
19 | * |
||
20 | * @return mixed |
||
21 | */ |
||
22 | 8 | public function current() |
|
26 | |||
27 | /** |
||
28 | * Return the fist element |
||
29 | * |
||
30 | * @return mixed |
||
31 | */ |
||
32 | 1 | public function first() |
|
36 | |||
37 | /** |
||
38 | * Advance and return last element |
||
39 | * |
||
40 | * @return mixed |
||
41 | */ |
||
42 | 4 | public function last() |
|
46 | |||
47 | /** |
||
48 | * Move elements pointer forward |
||
49 | * |
||
50 | * @return mixed |
||
51 | */ |
||
52 | 4 | public function next() |
|
56 | |||
57 | /** |
||
58 | * Move elements pointer backward |
||
59 | * |
||
60 | * @reutrn void |
||
61 | */ |
||
62 | 1 | public function prev() |
|
66 | |||
67 | /** |
||
68 | * Return the key of the current element |
||
69 | * |
||
70 | * @return mixed |
||
71 | */ |
||
72 | 6 | public function key() |
|
76 | |||
77 | /** |
||
78 | * Checks if current position is valid |
||
79 | * |
||
80 | * @return bool |
||
81 | */ |
||
82 | 2 | public function valid() |
|
86 | |||
87 | /** |
||
88 | * Reset pointer and return the first element |
||
89 | * |
||
90 | * @return mixed |
||
91 | */ |
||
92 | 2 | public function reset() |
|
96 | |||
97 | /** |
||
98 | * Rewind the collection pointer |
||
99 | * |
||
100 | * @return void |
||
101 | */ |
||
102 | 2 | public function rewind() |
|
106 | } |
||
107 |