1 | <?php declare(strict_types = 1); |
||
12 | class FileManager |
||
13 | { |
||
14 | /** |
||
15 | * FileManager constructor. |
||
16 | * @param Config $config Configuration Settings. |
||
17 | */ |
||
18 | public function __construct(Config $config) |
||
22 | |||
23 | /** |
||
24 | * Recursively finds all files with the .php extension in the provided |
||
25 | * $path and returns list as array. |
||
26 | * @param string $path Path to look for .php files. |
||
27 | * @return FileCollection |
||
28 | */ |
||
29 | public function getPhpFiles(string $path): FileCollection |
||
48 | |||
49 | /** |
||
50 | * Determines if a file should be ignored. |
||
51 | * @param \SplFileInfo $file File. |
||
52 | * @return boolean |
||
53 | */ |
||
54 | private function fileShouldBeIgnored(SplFileInfo $file): bool |
||
65 | } |
||
66 |
In PHP it is possible to write to properties without declaring them. For example, the following is perfectly valid PHP code:
Generally, it is a good practice to explictly declare properties to avoid accidental typos and provide IDE auto-completion: