1 | <?php |
||
5 | abstract class AbstractScalar |
||
6 | { |
||
7 | /** |
||
8 | * @var mixed |
||
9 | */ |
||
10 | protected $content = null; |
||
11 | |||
12 | /** |
||
13 | * @param mixed $content |
||
14 | * @throws \DeGraciaMathieu\FreezeMyScalar\Exceptions\CheckerException |
||
15 | */ |
||
16 | 3 | public function __construct($content) |
|
22 | |||
23 | /** |
||
24 | * @return return mixed |
||
25 | */ |
||
26 | 2 | public function content() |
|
30 | } |
||
31 |
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: