1 | <?php |
||
5 | class Str implements Interface_\ContentModelText |
||
6 | { |
||
7 | |||
8 | use Trait_\HooksToString; |
||
9 | protected $strContent = ''; |
||
10 | |||
11 | public function __construct($content) |
||
15 | |||
16 | public function setValue($content) |
||
20 | |||
21 | public function __toString() |
||
28 | |||
29 | public function setParent(Abstract_\ElementContent $objParent) |
||
33 | |||
34 | public function describe() |
||
38 | } |
||
39 |
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: