1 | <?php |
||
29 | trait Introduction |
||
30 | { |
||
31 | /** |
||
32 | * Set introduction |
||
33 | * |
||
34 | * @param null|string $introduction |
||
35 | * @return self |
||
36 | */ |
||
37 | 35 | public function setIntroduction($introduction = null) |
|
55 | |||
56 | /** |
||
57 | * Get introduction |
||
58 | * |
||
59 | * @return null|string |
||
60 | */ |
||
61 | 29 | public function getIntroduction() |
|
66 | } |
||
67 |
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: