1 | <?php |
||
15 | abstract class Iterator |
||
16 | { |
||
17 | 1 | use FilterTrait; |
|
18 | |||
19 | /** |
||
20 | * Iterate on the contents of the this iterator. |
||
21 | */ |
||
22 | 4 | public function iterateOn() : Iterator |
|
26 | |||
27 | /** |
||
28 | * Get an iterator for every content in the current iterator |
||
29 | * for which the provided predicate returns true. |
||
30 | * |
||
31 | * @param \Closure $predicate (a -> Bool) |
||
32 | */ |
||
33 | abstract public function filter(\Closure $predicate) : Iterator; |
||
34 | |||
35 | /** |
||
36 | * Map a function over the objects inside the iterator. |
||
37 | * |
||
38 | * @param \Closure $trans a -> b |
||
39 | */ |
||
40 | abstract public function map(\Closure $trans) : Iterator; |
||
41 | |||
42 | /** |
||
43 | * Define the function to be iterated with and close this level |
||
44 | * of iteration. |
||
45 | * |
||
46 | * @param \Closure $iteration a -> File|Directory -> a |
||
47 | * @return Iterator|mixed |
||
48 | */ |
||
49 | abstract public function fold($start_value, $iteration); |
||
50 | |||
51 | /** |
||
52 | * Like fold, but with no start value or return. |
||
53 | * |
||
54 | * @param \Closure $iteration File|Directory -> () |
||
55 | * @return Iterator|mixed |
||
56 | */ |
||
57 | 18 | public function with($iteration) |
|
75 | |||
76 | /** |
||
77 | * Close a level of iteration without an iteration function. |
||
78 | * |
||
79 | * @return Iterator|mixed |
||
80 | */ |
||
81 | 2 | public function run() |
|
86 | } |
||
87 |
This check looks from parameters that have been defined for a function or method, but which are not used in the method body.