1 | <?php |
||
15 | class DirectoryIterator extends Iterator |
||
16 | { |
||
17 | /** |
||
18 | * @var FixedFDirectory a |
||
19 | */ |
||
20 | protected $directory; |
||
21 | |||
22 | 18 | public function __construct(FixedFDirectory $directory) |
|
26 | |||
27 | /** |
||
28 | * Iterate on the contents of the this iterator. |
||
29 | */ |
||
30 | 6 | public function iterateOn() : Iterator |
|
34 | |||
35 | /** |
||
36 | * Get an iterator for every content in the current iterator |
||
37 | * for which the provided predicate returns true. |
||
38 | * |
||
39 | * @param \Closure $predicate (a -> Bool) |
||
40 | */ |
||
41 | 10 | public function filter(\Closure $predicate) : Iterator |
|
45 | |||
46 | /** |
||
47 | * Map a function over the objects inside the iterator. |
||
48 | * |
||
49 | * @param \Closure $trans a -> b |
||
50 | */ |
||
51 | 6 | public function map(\Closure $trans) : Iterator |
|
57 | |||
58 | /** |
||
59 | * Define the function to be iterated with and close this level |
||
60 | * of iteration. |
||
61 | * |
||
62 | * @param \Closure $iteration a -> File|Directory -> a |
||
63 | * @return mixed |
||
64 | */ |
||
65 | 18 | public function fold($start_value, $iteration) |
|
69 | } |
||
70 |