| 1 | <?php | ||
| 9 | class SuggestCorrectVariableNameSolution implements Solution | ||
| 10 | { | ||
| 11 | /** @var string */ | ||
| 12 | private $variableName; | ||
| 13 | |||
| 14 | /** @var string */ | ||
| 15 | private $viewFile; | ||
| 16 | |||
| 17 | public function __construct($variableName = null, $viewFile = null, $suggested = null) | ||
| 23 | |||
| 24 | public function getSolutionTitle(): string | ||
| 28 | |||
| 29 | public function getDocumentationLinks(): array | ||
| 33 | |||
| 34 | public function getSolutionDescription(): string | ||
| 40 | |||
| 41 | public function isRunnable(): bool | ||
| 45 | } | ||
| 46 | 
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: