1 | <?php |
||
9 | final class ColumnMetadata |
||
10 | { |
||
11 | private $name; |
||
12 | private $type; |
||
13 | private $groups = []; |
||
14 | private $options = []; |
||
15 | |||
16 | public function __construct( |
||
29 | |||
30 | public function getName(): string |
||
34 | |||
35 | public function getType(): string |
||
39 | |||
40 | public function getOptions(): array |
||
44 | |||
45 | public function getTags(): array |
||
49 | |||
50 | public function getGroups(): array |
||
54 | } |
||
55 |
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: