1 | <?php |
||
7 | class FilesFinder implements FinderInterface |
||
8 | { |
||
9 | /** @var string Путь к папке, в которой будем искать файлы */ |
||
10 | protected $path; |
||
11 | |||
12 | /** |
||
13 | * {@inheritdoc} |
||
14 | */ |
||
15 | public function __construct($path) |
||
24 | |||
25 | /** |
||
26 | * {@inheritdoc} |
||
27 | */ |
||
28 | public function findFiles($path = null) |
||
36 | } |
||
37 |
Instead of super-globals, we recommend to explicitly inject the dependencies of your class. This makes your code less dependent on global state and it becomes generally more testable: