1 | <?php |
||
7 | class SuggestCorrectVariableNameSolution implements Solution |
||
8 | { |
||
9 | /** @var string */ |
||
10 | private $variableName; |
||
11 | |||
12 | /** @var string */ |
||
13 | private $viewFile; |
||
14 | |||
15 | public function __construct($variableName = null, $viewFile = null, $suggested = null) |
||
21 | |||
22 | public function getSolutionTitle(): string |
||
26 | |||
27 | public function getDocumentationLinks(): array |
||
31 | |||
32 | public function getSolutionDescription(): string |
||
38 | |||
39 | public function isRunnable(): bool |
||
43 | } |
||
44 |
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: