1 | <?php |
||
33 | final class AframeDOMDocument extends DOMImplementation |
||
34 | { |
||
35 | use AframeDOMProcessor; |
||
36 | |||
37 | /** |
||
38 | * A-Frame DOM Document type |
||
39 | * |
||
40 | * @var \DOMDocumentType |
||
41 | */ |
||
42 | protected $doctypeObj; |
||
43 | |||
44 | /** |
||
45 | * A-Frame DOM Document |
||
46 | * |
||
47 | * @var \DOMDocument |
||
48 | */ |
||
49 | protected $docObj; |
||
50 | |||
51 | /** |
||
52 | * Scene meta tile |
||
53 | * |
||
54 | * @var string $scene_title |
||
55 | */ |
||
56 | protected $scene_title = 'Untitled'; |
||
57 | |||
58 | /** |
||
59 | * Scene meta description |
||
60 | * |
||
61 | * @var string $scene_description |
||
62 | */ |
||
63 | protected $scene_description = ''; |
||
64 | |||
65 | /** |
||
66 | * CDN Of aframe.js |
||
67 | * |
||
68 | * @var string |
||
69 | */ |
||
70 | protected $aframe_cdn; |
||
71 | |||
72 | /** |
||
73 | * Whether to use CDN |
||
74 | * |
||
75 | * @var bool $use_cdn |
||
76 | */ |
||
77 | protected $use_cdn = false; |
||
78 | |||
79 | /** |
||
80 | * <head> |
||
81 | * |
||
82 | * @var \DOMElement |
||
83 | */ |
||
84 | protected $head; |
||
85 | |||
86 | /** |
||
87 | * <body> |
||
88 | * |
||
89 | * @var \DOMElement |
||
90 | */ |
||
91 | protected $body; |
||
92 | |||
93 | /** |
||
94 | * <a-scene> |
||
95 | * |
||
96 | * @var \DOMElement |
||
97 | */ |
||
98 | protected $scene; |
||
99 | |||
100 | /** |
||
101 | * <a-assets> |
||
102 | * |
||
103 | * @var \DOMElement |
||
104 | */ |
||
105 | protected $assets; |
||
106 | |||
107 | /** |
||
108 | * Nicely formats output with indentation and extra space. |
||
109 | * |
||
110 | * @var bool |
||
111 | */ |
||
112 | protected $formatOutput = false; |
||
113 | |||
114 | /** |
||
115 | * A-Frame DOM |
||
116 | * |
||
117 | * @param Config $config |
||
118 | */ |
||
119 | 71 | public function __construct(Config $config) |
|
137 | |||
138 | /** |
||
139 | * Set CDN for aframe.js or min.js |
||
140 | * |
||
141 | * @param string $cdn |
||
142 | * @return void |
||
143 | */ |
||
144 | 71 | public function setCDN(string $cdn) |
|
148 | |||
149 | /** |
||
150 | * Render scene this DOM Object is attached to |
||
151 | * |
||
152 | * @return string |
||
153 | */ |
||
154 | 5 | public function render(): string |
|
171 | |||
172 | /** |
||
173 | * Set Scene meta title |
||
174 | * |
||
175 | * @param string $title |
||
176 | */ |
||
177 | 7 | public function setTitle(string $title) |
|
181 | |||
182 | /** |
||
183 | * Set Scene meta description |
||
184 | * |
||
185 | * @param string $description |
||
186 | */ |
||
187 | 7 | public function setDescription(string $description) |
|
191 | |||
192 | /** |
||
193 | * Append entities |
||
194 | * |
||
195 | * @param array $entities |
||
196 | * @return void |
||
197 | */ |
||
198 | 7 | public function appendEntities(array $entities) |
|
206 | |||
207 | /** |
||
208 | * Append assets |
||
209 | * |
||
210 | * @param array $assets |
||
211 | * @return void |
||
212 | */ |
||
213 | 2 | public function appendAssets(array $assets) |
|
226 | |||
227 | /** |
||
228 | * Append asset |
||
229 | * |
||
230 | * Create asset DOMElement |
||
231 | * |
||
232 | * @param AssetsInterface $asset |
||
233 | */ |
||
234 | 2 | public function appendAsset(AssetsInterface $asset) |
|
239 | |||
240 | /** |
||
241 | * Create entity DOMElement |
||
242 | * |
||
243 | * Created entity and append it to scene |
||
244 | * |
||
245 | * @param Entity $entity |
||
246 | * @return void |
||
247 | */ |
||
248 | 2 | public function appendEntity(Entity $entity) |
|
253 | |||
254 | /** |
||
255 | * Get HTML of Scene only |
||
256 | * |
||
257 | * @return string |
||
258 | */ |
||
259 | 3 | public function renderSceneOnly() |
|
268 | } |
||
269 |
This check looks for multiple assignments in successive lines of code. It will report an issue if the operators are not in a straight line.
To visualize
will produce issues in the first and second line, while this second example
will produce no issues.