1 | <?php |
||
5 | trait ElementPlacementTrait |
||
6 | { |
||
7 | /** |
||
8 | * @return string |
||
9 | */ |
||
10 | public function getPlacement() |
||
14 | |||
15 | /** |
||
16 | * @param string $placement |
||
17 | * |
||
18 | * @return $this |
||
19 | */ |
||
20 | public function setPlacement($placement) |
||
26 | |||
27 | /** |
||
28 | * @deprecated use getPlacement() |
||
29 | * @return string |
||
30 | */ |
||
31 | public function getPosition() |
||
35 | |||
36 | /** |
||
37 | * @deprecated use setPlacement(string $placement) |
||
38 | * @param string $position |
||
39 | * |
||
40 | * @return $this |
||
41 | */ |
||
42 | public function setPosition($position) |
||
46 | } |
||
47 |
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: