| 1 | <?php |
||
| 19 | class Builder |
||
| 20 | { |
||
| 21 | /** |
||
| 22 | * @var array list of configs to build: name => array of pathes |
||
| 23 | */ |
||
| 24 | public $configs = []; |
||
| 25 | |||
| 26 | |||
| 27 | const BASE_DIR_SAMPLE = '<base-dir>'; |
||
| 28 | |||
| 29 | protected function assembleFile($name, array $configs) |
||
| 34 | |||
| 35 | /** |
||
| 36 | * Writes config file. |
||
| 37 | * @param string $path |
||
| 38 | * @param array $data |
||
| 39 | */ |
||
| 40 | protected function writeFile($path, array $data) |
||
| 49 | |||
| 50 | } |
||
| 51 |
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: