1 | <?php |
||
35 | class FileFinder |
||
36 | { |
||
37 | |||
38 | /** |
||
39 | * @var array $filterlist |
||
40 | */ |
||
41 | protected $filterlist = array(); |
||
42 | |||
43 | /** |
||
44 | * @var array $searchLocation |
||
45 | */ |
||
46 | protected $searchLocations = array(); |
||
47 | |||
48 | /** |
||
49 | * @var FileListInterface $fileList |
||
50 | */ |
||
51 | protected $fileList = null; |
||
52 | |||
53 | /** |
||
54 | * Add a further filter |
||
55 | * |
||
56 | * @param FilterInterface $filter |
||
57 | * |
||
58 | * @return self |
||
59 | */ |
||
60 | 3 | public function addFilter(FilterInterface $filter) |
|
66 | |||
67 | /** |
||
68 | * Add a further directory to search for files in |
||
69 | * |
||
70 | * @param string $dir |
||
71 | * |
||
72 | * @return self |
||
73 | */ |
||
74 | 3 | public function addDirectory($dir) |
|
80 | |||
81 | /** |
||
82 | * Set the file list |
||
83 | * |
||
84 | * @param FileListInterface $fileList |
||
85 | * |
||
86 | * @return self |
||
87 | */ |
||
88 | 2 | public function setFileList(FileListInterface $fileList) |
|
94 | |||
95 | /** |
||
96 | * Get the file list |
||
97 | * |
||
98 | * @return FileListInterface |
||
99 | */ |
||
100 | 3 | public function getFileList() |
|
107 | |||
108 | /** |
||
109 | * Do the actual searching |
||
110 | * |
||
111 | * @return FileListInterface[] |
||
112 | */ |
||
113 | 2 | public function find() |
|
131 | |||
132 | /** |
||
133 | * Filter the file |
||
134 | * |
||
135 | * @param SPLFileInfo $file |
||
136 | * |
||
137 | * @return bool |
||
138 | */ |
||
139 | 2 | public function filter(\SPLFileInfo $file) |
|
148 | } |
||
149 |