| 1 | <?php declare(strict_types = 1); |
||
| 11 | class FileManager |
||
| 12 | { |
||
| 13 | /** |
||
| 14 | * FileManager constructor. |
||
| 15 | * @param Config $config Configuration Settings. |
||
| 16 | */ |
||
| 17 | public function __construct(Config $config) |
||
| 21 | |||
| 22 | /** |
||
| 23 | * Recursively finds all files with the .php extension in the provided |
||
| 24 | * $path and returns list as array. |
||
| 25 | * @param string $path Path to look for .php files. |
||
| 26 | * @return FileCollection |
||
| 27 | */ |
||
| 28 | public function getPhpFiles(string $path): FileCollection |
||
| 46 | } |
||
| 47 |
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: