| 1 | <?php |
||
| 7 | abstract class BaseOptimizer implements Optimizer |
||
| 8 | { |
||
| 9 | public $options = []; |
||
| 10 | |||
| 11 | public $imagePath = ''; |
||
| 12 | |||
| 13 | public $binaryPath = ''; |
||
| 14 | |||
| 15 | public function __construct($options = []) |
||
| 19 | |||
| 20 | public function binaryName(): string |
||
| 24 | |||
| 25 | public function setBinaryPath(string $binaryPath) |
||
| 35 | |||
| 36 | public function setImagePath(string $imagePath) |
||
| 42 | |||
| 43 | public function setOptions(array $options = []) |
||
| 49 | |||
| 50 | public function getCommand(): string |
||
| 56 | } |
||
| 57 |
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: