1 | <?php |
||
13 | class EmbedMetadata implements Interfaces\AttributeInterface, Interfaces\EmbedInterface, Interfaces\MixinInterface |
||
14 | { |
||
15 | /** |
||
16 | * Uses attributes. |
||
17 | */ |
||
18 | use Traits\AttributesTrait; |
||
19 | |||
20 | /** |
||
21 | * Uses embeds. |
||
22 | */ |
||
23 | use Traits\EmbedsTrait; |
||
24 | |||
25 | /** |
||
26 | * Uses mixins. |
||
27 | */ |
||
28 | use Traits\MixinsTrait; |
||
29 | |||
30 | /** |
||
31 | * Uses merged properties. |
||
32 | */ |
||
33 | use Traits\PropertiesTrait; |
||
34 | |||
35 | /** |
||
36 | * The embed name/key. |
||
37 | * |
||
38 | * @var string |
||
39 | */ |
||
40 | public $name; |
||
41 | |||
42 | /** |
||
43 | * Constructor. |
||
44 | * |
||
45 | * @param string $name The embed name. |
||
46 | */ |
||
47 | public function __construct($name) |
||
51 | |||
52 | /** |
||
53 | * {@inheritdoc} |
||
54 | */ |
||
55 | public function getProperties() |
||
59 | |||
60 | /** |
||
61 | * {@inheritdoc} |
||
62 | */ |
||
63 | protected function applyMixinProperties(MixinMetadata $mixin) |
||
78 | |||
79 | /** |
||
80 | * {@inheritdoc} |
||
81 | */ |
||
82 | protected function validateAttribute(AttributeMetadata $attribute) |
||
88 | |||
89 | /** |
||
90 | * {@inheritdoc} |
||
91 | */ |
||
92 | protected function validateEmbed(EmbeddedPropMetadata $embed) |
||
98 | } |
||
99 |
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: