1 | <?php |
||
26 | trait AframeDOMProcessor |
||
27 | { |
||
28 | |||
29 | /** |
||
30 | * Add document comment for formatting |
||
31 | * |
||
32 | * @param string $element |
||
33 | * @param string $comment |
||
34 | */ |
||
35 | 4 | protected function appendFormatComment(string $element, string $comment) |
|
42 | |||
43 | /** |
||
44 | * Correct html format for tags which are not supported by DOMDocument |
||
45 | * |
||
46 | * @param string $html |
||
47 | * @return string |
||
48 | */ |
||
49 | 4 | protected function correctOutputFormat($html) |
|
67 | |||
68 | /** |
||
69 | * Prepeare head |
||
70 | * |
||
71 | * @return void |
||
72 | */ |
||
73 | 5 | protected function renderHead() |
|
80 | |||
81 | /** |
||
82 | * Append deffault metatags |
||
83 | * |
||
84 | * @return void |
||
85 | */ |
||
86 | 5 | protected function appendDefaultMetaTags() |
|
95 | |||
96 | /** |
||
97 | * Get default meta tags |
||
98 | * |
||
99 | * @return array |
||
100 | */ |
||
101 | 5 | protected function getDefaultMetaTags(): array |
|
118 | |||
119 | /** |
||
120 | * If requested by user use aframe CDN |
||
121 | * |
||
122 | * @return void |
||
123 | */ |
||
124 | 5 | protected function appendCDN() |
|
132 | |||
133 | /** |
||
134 | * Prepare body |
||
135 | * |
||
136 | * @return void |
||
137 | */ |
||
138 | 5 | protected function renderBody() |
|
142 | |||
143 | /** |
||
144 | * Create meta tags |
||
145 | * |
||
146 | * @param array $attr |
||
147 | */ |
||
148 | 5 | protected function appendMetaTag(array $attr) |
|
155 | |||
156 | /** |
||
157 | * Creates an empty DOMDocumentType object |
||
158 | * |
||
159 | * @param string $doctype |
||
160 | * @return void |
||
161 | */ |
||
162 | 71 | protected function createDocType(string $doctype) |
|
166 | |||
167 | /** |
||
168 | * Creates a DOMDocument object of the specified type with its document element |
||
169 | * |
||
170 | * @return void |
||
171 | */ |
||
172 | 71 | protected function createAframeDocument() |
|
176 | |||
177 | /** |
||
178 | * Create dom elements for DOMDocument |
||
179 | * |
||
180 | * @return void |
||
181 | */ |
||
182 | 71 | protected function documentBootstrap() |
|
193 | } |
||
194 |
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: