Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
Total | |
0.00% |
0 / 460 |
|
0.00% |
0 / 6 |
CRAP | |
0.00% |
0 / 1 |
HTMLMapElement | |
0.00% |
0 / 460 |
|
0.00% |
0 / 6 |
47742 | |
0.00% |
0 / 1 |
_getMissingProp | n/a |
0 / 0 |
n/a |
0 / 0 |
0 | |||||
_setMissingProp | n/a |
0 / 0 |
n/a |
0 / 0 |
0 | |||||
__get | |
0.00% |
0 / 122 |
|
0.00% |
0 / 1 |
3906 | |||
__isset | |
0.00% |
0 / 122 |
|
0.00% |
0 / 1 |
3906 | |||
__set | |
0.00% |
0 / 80 |
|
0.00% |
0 / 1 |
812 | |||
__unset | |
0.00% |
0 / 134 |
|
0.00% |
0 / 1 |
4160 | |||
getName | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
setName | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 |
1 | <?php |
2 | |
3 | // AUTOMATICALLY GENERATED. DO NOT EDIT. |
4 | // Use `composer build` to regenerate. |
5 | |
6 | namespace Wikimedia\IDLeDOM\Helper; |
7 | |
8 | trait HTMLMapElement { |
9 | |
10 | // Underscore is used to avoid conflicts with DOM-reserved names |
11 | // phpcs:disable PSR2.Methods.MethodDeclaration.Underscore |
12 | // phpcs:disable MediaWiki.NamingConventions.LowerCamelFunctionsName.FunctionName |
13 | |
14 | /** |
15 | * Handle an attempt to get a non-existing property on this |
16 | * object. The default implementation raises an exception |
17 | * but the implementor can choose a different behavior: |
18 | * return null (like JavaScript), dynamically create the |
19 | * property, etc. |
20 | * @param string $prop the name of the property requested |
21 | * @return mixed |
22 | */ |
23 | abstract protected function _getMissingProp( string $prop ); |
24 | |
25 | /** |
26 | * Handle an attempt to set a non-existing property on this |
27 | * object. The default implementation raises an exception |
28 | * but the implementor can choose a different behavior: |
29 | * ignore the operation (like JavaScript), dynamically create |
30 | * the property, etc. |
31 | * @param string $prop the name of the property requested |
32 | * @param mixed $value the value to set |
33 | */ |
34 | abstract protected function _setMissingProp( string $prop, $value ): void; |
35 | |
36 | // phpcs:enable |
37 | |
38 | /** |
39 | * @param string $name |
40 | * @return mixed |
41 | */ |
42 | public function __get( string $name ) { |
43 | '@phan-var \Wikimedia\IDLeDOM\HTMLMapElement $this'; |
44 | // @var \Wikimedia\IDLeDOM\HTMLMapElement $this |
45 | switch ( $name ) { |
46 | case "nodeType": |
47 | return $this->getNodeType(); |
48 | case "nodeName": |
49 | return $this->getNodeName(); |
50 | case "baseURI": |
51 | return $this->getBaseURI(); |
52 | case "isConnected": |
53 | return $this->getIsConnected(); |
54 | case "ownerDocument": |
55 | return $this->getOwnerDocument(); |
56 | case "parentNode": |
57 | return $this->getParentNode(); |
58 | case "parentElement": |
59 | return $this->getParentElement(); |
60 | case "childNodes": |
61 | return $this->getChildNodes(); |
62 | case "firstChild": |
63 | return $this->getFirstChild(); |
64 | case "lastChild": |
65 | return $this->getLastChild(); |
66 | case "previousSibling": |
67 | return $this->getPreviousSibling(); |
68 | case "nextSibling": |
69 | return $this->getNextSibling(); |
70 | case "nodeValue": |
71 | return $this->getNodeValue(); |
72 | case "textContent": |
73 | return $this->getTextContent(); |
74 | case "innerHTML": |
75 | return $this->getInnerHTML(); |
76 | case "previousElementSibling": |
77 | return $this->getPreviousElementSibling(); |
78 | case "nextElementSibling": |
79 | return $this->getNextElementSibling(); |
80 | case "children": |
81 | return $this->getChildren(); |
82 | case "firstElementChild": |
83 | return $this->getFirstElementChild(); |
84 | case "lastElementChild": |
85 | return $this->getLastElementChild(); |
86 | case "childElementCount": |
87 | return $this->getChildElementCount(); |
88 | case "assignedSlot": |
89 | return $this->getAssignedSlot(); |
90 | case "namespaceURI": |
91 | return $this->getNamespaceURI(); |
92 | case "prefix": |
93 | return $this->getPrefix(); |
94 | case "localName": |
95 | return $this->getLocalName(); |
96 | case "tagName": |
97 | return $this->getTagName(); |
98 | case "id": |
99 | return $this->getId(); |
100 | case "className": |
101 | return $this->getClassName(); |
102 | case "classList": |
103 | return $this->getClassList(); |
104 | case "slot": |
105 | return $this->getSlot(); |
106 | case "attributes": |
107 | return $this->getAttributes(); |
108 | case "shadowRoot": |
109 | return $this->getShadowRoot(); |
110 | case "outerHTML": |
111 | return $this->getOuterHTML(); |
112 | case "style": |
113 | return $this->getStyle(); |
114 | case "contentEditable": |
115 | return $this->getContentEditable(); |
116 | case "enterKeyHint": |
117 | return $this->getEnterKeyHint(); |
118 | case "isContentEditable": |
119 | return $this->getIsContentEditable(); |
120 | case "inputMode": |
121 | return $this->getInputMode(); |
122 | case "onload": |
123 | return $this->getOnload(); |
124 | case "dataset": |
125 | return $this->getDataset(); |
126 | case "nonce": |
127 | return $this->getNonce(); |
128 | case "tabIndex": |
129 | return $this->getTabIndex(); |
130 | case "title": |
131 | return $this->getTitle(); |
132 | case "lang": |
133 | return $this->getLang(); |
134 | case "translate": |
135 | return $this->getTranslate(); |
136 | case "dir": |
137 | return $this->getDir(); |
138 | case "hidden": |
139 | return $this->getHidden(); |
140 | case "accessKey": |
141 | return $this->getAccessKey(); |
142 | case "accessKeyLabel": |
143 | return $this->getAccessKeyLabel(); |
144 | case "draggable": |
145 | return $this->getDraggable(); |
146 | case "spellcheck": |
147 | return $this->getSpellcheck(); |
148 | case "autocapitalize": |
149 | return $this->getAutocapitalize(); |
150 | case "innerText": |
151 | return $this->getInnerText(); |
152 | case "offsetParent": |
153 | return $this->getOffsetParent(); |
154 | case "offsetTop": |
155 | return $this->getOffsetTop(); |
156 | case "offsetLeft": |
157 | return $this->getOffsetLeft(); |
158 | case "offsetWidth": |
159 | return $this->getOffsetWidth(); |
160 | case "offsetHeight": |
161 | return $this->getOffsetHeight(); |
162 | case "name": |
163 | return $this->getName(); |
164 | case "areas": |
165 | return $this->getAreas(); |
166 | default: |
167 | break; |
168 | } |
169 | '@phan-var \Wikimedia\IDLeDOM\Helper\HTMLMapElement $this'; |
170 | // @var \Wikimedia\IDLeDOM\Helper\HTMLMapElement $this |
171 | return $this->_getMissingProp( $name ); |
172 | } |
173 | |
174 | /** |
175 | * @param string $name |
176 | * @return bool |
177 | */ |
178 | public function __isset( string $name ): bool { |
179 | '@phan-var \Wikimedia\IDLeDOM\HTMLMapElement $this'; |
180 | // @var \Wikimedia\IDLeDOM\HTMLMapElement $this |
181 | switch ( $name ) { |
182 | case "nodeType": |
183 | return true; |
184 | case "nodeName": |
185 | return true; |
186 | case "baseURI": |
187 | return true; |
188 | case "isConnected": |
189 | return true; |
190 | case "ownerDocument": |
191 | return $this->getOwnerDocument() !== null; |
192 | case "parentNode": |
193 | return $this->getParentNode() !== null; |
194 | case "parentElement": |
195 | return $this->getParentElement() !== null; |
196 | case "childNodes": |
197 | return true; |
198 | case "firstChild": |
199 | return $this->getFirstChild() !== null; |
200 | case "lastChild": |
201 | return $this->getLastChild() !== null; |
202 | case "previousSibling": |
203 | return $this->getPreviousSibling() !== null; |
204 | case "nextSibling": |
205 | return $this->getNextSibling() !== null; |
206 | case "nodeValue": |
207 | return $this->getNodeValue() !== null; |
208 | case "textContent": |
209 | return $this->getTextContent() !== null; |
210 | case "innerHTML": |
211 | return true; |
212 | case "previousElementSibling": |
213 | return $this->getPreviousElementSibling() !== null; |
214 | case "nextElementSibling": |
215 | return $this->getNextElementSibling() !== null; |
216 | case "children": |
217 | return true; |
218 | case "firstElementChild": |
219 | return $this->getFirstElementChild() !== null; |
220 | case "lastElementChild": |
221 | return $this->getLastElementChild() !== null; |
222 | case "childElementCount": |
223 | return true; |
224 | case "assignedSlot": |
225 | return $this->getAssignedSlot() !== null; |
226 | case "namespaceURI": |
227 | return $this->getNamespaceURI() !== null; |
228 | case "prefix": |
229 | return $this->getPrefix() !== null; |
230 | case "localName": |
231 | return true; |
232 | case "tagName": |
233 | return true; |
234 | case "id": |
235 | return true; |
236 | case "className": |
237 | return true; |
238 | case "classList": |
239 | return true; |
240 | case "slot": |
241 | return true; |
242 | case "attributes": |
243 | return true; |
244 | case "shadowRoot": |
245 | return $this->getShadowRoot() !== null; |
246 | case "outerHTML": |
247 | return true; |
248 | case "style": |
249 | return true; |
250 | case "contentEditable": |
251 | return true; |
252 | case "enterKeyHint": |
253 | return true; |
254 | case "isContentEditable": |
255 | return true; |
256 | case "inputMode": |
257 | return true; |
258 | case "onload": |
259 | return true; |
260 | case "dataset": |
261 | return true; |
262 | case "nonce": |
263 | return true; |
264 | case "tabIndex": |
265 | return true; |
266 | case "title": |
267 | return true; |
268 | case "lang": |
269 | return true; |
270 | case "translate": |
271 | return true; |
272 | case "dir": |
273 | return true; |
274 | case "hidden": |
275 | return true; |
276 | case "accessKey": |
277 | return true; |
278 | case "accessKeyLabel": |
279 | return true; |
280 | case "draggable": |
281 | return true; |
282 | case "spellcheck": |
283 | return true; |
284 | case "autocapitalize": |
285 | return true; |
286 | case "innerText": |
287 | return true; |
288 | case "offsetParent": |
289 | return $this->getOffsetParent() !== null; |
290 | case "offsetTop": |
291 | return true; |
292 | case "offsetLeft": |
293 | return true; |
294 | case "offsetWidth": |
295 | return true; |
296 | case "offsetHeight": |
297 | return true; |
298 | case "name": |
299 | return true; |
300 | case "areas": |
301 | return true; |
302 | default: |
303 | break; |
304 | } |
305 | return false; |
306 | } |
307 | |
308 | /** |
309 | * @param string $name |
310 | * @param mixed $value |
311 | */ |
312 | public function __set( string $name, $value ): void { |
313 | '@phan-var \Wikimedia\IDLeDOM\HTMLMapElement $this'; |
314 | // @var \Wikimedia\IDLeDOM\HTMLMapElement $this |
315 | switch ( $name ) { |
316 | case "nodeValue": |
317 | $this->setNodeValue( $value ); |
318 | return; |
319 | case "textContent": |
320 | $this->setTextContent( $value ); |
321 | return; |
322 | case "innerHTML": |
323 | $this->setInnerHTML( $value ); |
324 | return; |
325 | case "id": |
326 | $this->setId( $value ); |
327 | return; |
328 | case "className": |
329 | $this->setClassName( $value ); |
330 | return; |
331 | case "classList": |
332 | $this->setClassList( $value ); |
333 | return; |
334 | case "slot": |
335 | $this->setSlot( $value ); |
336 | return; |
337 | case "outerHTML": |
338 | $this->setOuterHTML( $value ); |
339 | return; |
340 | case "style": |
341 | $this->setStyle( $value ); |
342 | return; |
343 | case "contentEditable": |
344 | $this->setContentEditable( $value ); |
345 | return; |
346 | case "enterKeyHint": |
347 | $this->setEnterKeyHint( $value ); |
348 | return; |
349 | case "inputMode": |
350 | $this->setInputMode( $value ); |
351 | return; |
352 | case "onload": |
353 | $this->setOnload( $value ); |
354 | return; |
355 | case "nonce": |
356 | $this->setNonce( $value ); |
357 | return; |
358 | case "tabIndex": |
359 | $this->setTabIndex( $value ); |
360 | return; |
361 | case "title": |
362 | $this->setTitle( $value ); |
363 | return; |
364 | case "lang": |
365 | $this->setLang( $value ); |
366 | return; |
367 | case "translate": |
368 | $this->setTranslate( $value ); |
369 | return; |
370 | case "dir": |
371 | $this->setDir( $value ); |
372 | return; |
373 | case "hidden": |
374 | $this->setHidden( $value ); |
375 | return; |
376 | case "accessKey": |
377 | $this->setAccessKey( $value ); |
378 | return; |
379 | case "draggable": |
380 | $this->setDraggable( $value ); |
381 | return; |
382 | case "spellcheck": |
383 | $this->setSpellcheck( $value ); |
384 | return; |
385 | case "autocapitalize": |
386 | $this->setAutocapitalize( $value ); |
387 | return; |
388 | case "innerText": |
389 | $this->setInnerText( $value ); |
390 | return; |
391 | case "name": |
392 | $this->setName( $value ); |
393 | return; |
394 | default: |
395 | break; |
396 | } |
397 | '@phan-var \Wikimedia\IDLeDOM\Helper\HTMLMapElement $this'; |
398 | // @var \Wikimedia\IDLeDOM\Helper\HTMLMapElement $this |
399 | $this->_setMissingProp( $name, $value ); |
400 | } |
401 | |
402 | /** |
403 | * @param string $name |
404 | */ |
405 | public function __unset( string $name ): void { |
406 | '@phan-var \Wikimedia\IDLeDOM\HTMLMapElement $this'; |
407 | // @var \Wikimedia\IDLeDOM\HTMLMapElement $this |
408 | switch ( $name ) { |
409 | case "nodeType": |
410 | break; |
411 | case "nodeName": |
412 | break; |
413 | case "baseURI": |
414 | break; |
415 | case "isConnected": |
416 | break; |
417 | case "ownerDocument": |
418 | break; |
419 | case "parentNode": |
420 | break; |
421 | case "parentElement": |
422 | break; |
423 | case "childNodes": |
424 | break; |
425 | case "firstChild": |
426 | break; |
427 | case "lastChild": |
428 | break; |
429 | case "previousSibling": |
430 | break; |
431 | case "nextSibling": |
432 | break; |
433 | case "nodeValue": |
434 | $this->setNodeValue( null ); |
435 | return; |
436 | case "textContent": |
437 | $this->setTextContent( null ); |
438 | return; |
439 | case "innerHTML": |
440 | break; |
441 | case "previousElementSibling": |
442 | break; |
443 | case "nextElementSibling": |
444 | break; |
445 | case "children": |
446 | break; |
447 | case "firstElementChild": |
448 | break; |
449 | case "lastElementChild": |
450 | break; |
451 | case "childElementCount": |
452 | break; |
453 | case "assignedSlot": |
454 | break; |
455 | case "namespaceURI": |
456 | break; |
457 | case "prefix": |
458 | break; |
459 | case "localName": |
460 | break; |
461 | case "tagName": |
462 | break; |
463 | case "id": |
464 | break; |
465 | case "className": |
466 | break; |
467 | case "classList": |
468 | break; |
469 | case "slot": |
470 | break; |
471 | case "attributes": |
472 | break; |
473 | case "shadowRoot": |
474 | break; |
475 | case "outerHTML": |
476 | break; |
477 | case "style": |
478 | break; |
479 | case "contentEditable": |
480 | break; |
481 | case "enterKeyHint": |
482 | break; |
483 | case "isContentEditable": |
484 | break; |
485 | case "inputMode": |
486 | break; |
487 | case "onload": |
488 | break; |
489 | case "dataset": |
490 | break; |
491 | case "nonce": |
492 | break; |
493 | case "tabIndex": |
494 | break; |
495 | case "title": |
496 | break; |
497 | case "lang": |
498 | break; |
499 | case "translate": |
500 | break; |
501 | case "dir": |
502 | break; |
503 | case "hidden": |
504 | break; |
505 | case "accessKey": |
506 | break; |
507 | case "accessKeyLabel": |
508 | break; |
509 | case "draggable": |
510 | break; |
511 | case "spellcheck": |
512 | break; |
513 | case "autocapitalize": |
514 | break; |
515 | case "innerText": |
516 | break; |
517 | case "offsetParent": |
518 | break; |
519 | case "offsetTop": |
520 | break; |
521 | case "offsetLeft": |
522 | break; |
523 | case "offsetWidth": |
524 | break; |
525 | case "offsetHeight": |
526 | break; |
527 | case "name": |
528 | break; |
529 | case "areas": |
530 | break; |
531 | default: |
532 | return; |
533 | } |
534 | $trace = debug_backtrace(); |
535 | while ( |
536 | count( $trace ) > 0 && |
537 | $trace[0]['function'] !== "__unset" |
538 | ) { |
539 | array_shift( $trace ); |
540 | } |
541 | trigger_error( |
542 | 'Undefined property' . |
543 | ' via ' . ( $trace[0]['function'] ?? '' ) . '(): ' . $name . |
544 | ' in ' . ( $trace[0]['file'] ?? '' ) . |
545 | ' on line ' . ( $trace[0]['line'] ?? '' ), |
546 | E_USER_NOTICE |
547 | ); |
548 | } |
549 | |
550 | /** |
551 | * @return string |
552 | */ |
553 | public function getName(): string { |
554 | '@phan-var \Wikimedia\IDLeDOM\Element $this'; |
555 | // @var \Wikimedia\IDLeDOM\Element $this |
556 | return $this->getAttribute( 'name' ) ?? ''; |
557 | } |
558 | |
559 | /** |
560 | * @param string $val |
561 | */ |
562 | public function setName( string $val ): void { |
563 | '@phan-var \Wikimedia\IDLeDOM\Element $this'; |
564 | // @var \Wikimedia\IDLeDOM\Element $this |
565 | $this->setAttribute( 'name', $val ); |
566 | } |
567 | |
568 | } |