1 | <?php |
||
16 | class Enumerator |
||
17 | { |
||
18 | /** |
||
19 | * Path to the root directory, where enumeration should start |
||
20 | * |
||
21 | * @var string |
||
22 | */ |
||
23 | private $rootDirectory; |
||
24 | |||
25 | /** |
||
26 | * List of additional include paths, should be below rootDirectory |
||
27 | * |
||
28 | * @var array |
||
29 | */ |
||
30 | private $includePaths; |
||
31 | |||
32 | /** |
||
33 | * List of additional exclude paths, should be below rootDirectory |
||
34 | * |
||
35 | * @var array |
||
36 | */ |
||
37 | private $excludePaths; |
||
38 | |||
39 | /** |
||
40 | * Initializes an enumerator |
||
41 | * |
||
42 | * @param string $rootDirectory Path to the root directory |
||
43 | * @param array $includePaths List of additional include paths |
||
44 | * @param array $excludePaths List of additional exclude paths |
||
45 | */ |
||
46 | public function __construct($rootDirectory, array $includePaths = [], array $excludePaths = []) |
||
52 | |||
53 | /** |
||
54 | * Returns an enumerator for files |
||
55 | * |
||
56 | * @return \CallbackFilterIterator|\RecursiveIteratorIterator|\SplFileInfo[] |
||
57 | */ |
||
58 | public function enumerate() |
||
72 | |||
73 | /** |
||
74 | * Returns a filter callback for enumerating files |
||
75 | * |
||
76 | * @return \Closure |
||
77 | */ |
||
78 | public function getFilter() |
||
117 | } |
||
118 |