Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
Total | |
0.00% |
0 / 509 |
|
0.00% |
0 / 16 |
CRAP | |
0.00% |
0 / 1 |
HTMLBodyElement | |
0.00% |
0 / 509 |
|
0.00% |
0 / 16 |
60270 | |
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 / 130 |
|
0.00% |
0 / 1 |
4422 | |||
__isset | |
0.00% |
0 / 130 |
|
0.00% |
0 / 1 |
4422 | |||
__set | |
0.00% |
0 / 95 |
|
0.00% |
0 / 1 |
1122 | |||
__unset | |
0.00% |
0 / 142 |
|
0.00% |
0 / 1 |
4692 | |||
getText | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
setText | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
getLink | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
setLink | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
getVLink | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
setVLink | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
getALink | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
setALink | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
getBgColor | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
setBgColor | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
getBackground | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
setBackground | |
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 HTMLBodyElement { |
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\HTMLBodyElement $this'; |
44 | // @var \Wikimedia\IDLeDOM\HTMLBodyElement $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 "text": |
163 | return $this->getText(); |
164 | case "link": |
165 | return $this->getLink(); |
166 | case "vLink": |
167 | return $this->getVLink(); |
168 | case "aLink": |
169 | return $this->getALink(); |
170 | case "bgColor": |
171 | return $this->getBgColor(); |
172 | case "background": |
173 | return $this->getBackground(); |
174 | default: |
175 | break; |
176 | } |
177 | '@phan-var \Wikimedia\IDLeDOM\Helper\HTMLBodyElement $this'; |
178 | // @var \Wikimedia\IDLeDOM\Helper\HTMLBodyElement $this |
179 | return $this->_getMissingProp( $name ); |
180 | } |
181 | |
182 | /** |
183 | * @param string $name |
184 | * @return bool |
185 | */ |
186 | public function __isset( string $name ): bool { |
187 | '@phan-var \Wikimedia\IDLeDOM\HTMLBodyElement $this'; |
188 | // @var \Wikimedia\IDLeDOM\HTMLBodyElement $this |
189 | switch ( $name ) { |
190 | case "nodeType": |
191 | return true; |
192 | case "nodeName": |
193 | return true; |
194 | case "baseURI": |
195 | return true; |
196 | case "isConnected": |
197 | return true; |
198 | case "ownerDocument": |
199 | return $this->getOwnerDocument() !== null; |
200 | case "parentNode": |
201 | return $this->getParentNode() !== null; |
202 | case "parentElement": |
203 | return $this->getParentElement() !== null; |
204 | case "childNodes": |
205 | return true; |
206 | case "firstChild": |
207 | return $this->getFirstChild() !== null; |
208 | case "lastChild": |
209 | return $this->getLastChild() !== null; |
210 | case "previousSibling": |
211 | return $this->getPreviousSibling() !== null; |
212 | case "nextSibling": |
213 | return $this->getNextSibling() !== null; |
214 | case "nodeValue": |
215 | return $this->getNodeValue() !== null; |
216 | case "textContent": |
217 | return $this->getTextContent() !== null; |
218 | case "innerHTML": |
219 | return true; |
220 | case "previousElementSibling": |
221 | return $this->getPreviousElementSibling() !== null; |
222 | case "nextElementSibling": |
223 | return $this->getNextElementSibling() !== null; |
224 | case "children": |
225 | return true; |
226 | case "firstElementChild": |
227 | return $this->getFirstElementChild() !== null; |
228 | case "lastElementChild": |
229 | return $this->getLastElementChild() !== null; |
230 | case "childElementCount": |
231 | return true; |
232 | case "assignedSlot": |
233 | return $this->getAssignedSlot() !== null; |
234 | case "namespaceURI": |
235 | return $this->getNamespaceURI() !== null; |
236 | case "prefix": |
237 | return $this->getPrefix() !== null; |
238 | case "localName": |
239 | return true; |
240 | case "tagName": |
241 | return true; |
242 | case "id": |
243 | return true; |
244 | case "className": |
245 | return true; |
246 | case "classList": |
247 | return true; |
248 | case "slot": |
249 | return true; |
250 | case "attributes": |
251 | return true; |
252 | case "shadowRoot": |
253 | return $this->getShadowRoot() !== null; |
254 | case "outerHTML": |
255 | return true; |
256 | case "style": |
257 | return true; |
258 | case "contentEditable": |
259 | return true; |
260 | case "enterKeyHint": |
261 | return true; |
262 | case "isContentEditable": |
263 | return true; |
264 | case "inputMode": |
265 | return true; |
266 | case "onload": |
267 | return true; |
268 | case "dataset": |
269 | return true; |
270 | case "nonce": |
271 | return true; |
272 | case "tabIndex": |
273 | return true; |
274 | case "title": |
275 | return true; |
276 | case "lang": |
277 | return true; |
278 | case "translate": |
279 | return true; |
280 | case "dir": |
281 | return true; |
282 | case "hidden": |
283 | return true; |
284 | case "accessKey": |
285 | return true; |
286 | case "accessKeyLabel": |
287 | return true; |
288 | case "draggable": |
289 | return true; |
290 | case "spellcheck": |
291 | return true; |
292 | case "autocapitalize": |
293 | return true; |
294 | case "innerText": |
295 | return true; |
296 | case "offsetParent": |
297 | return $this->getOffsetParent() !== null; |
298 | case "offsetTop": |
299 | return true; |
300 | case "offsetLeft": |
301 | return true; |
302 | case "offsetWidth": |
303 | return true; |
304 | case "offsetHeight": |
305 | return true; |
306 | case "text": |
307 | return true; |
308 | case "link": |
309 | return true; |
310 | case "vLink": |
311 | return true; |
312 | case "aLink": |
313 | return true; |
314 | case "bgColor": |
315 | return true; |
316 | case "background": |
317 | return true; |
318 | default: |
319 | break; |
320 | } |
321 | return false; |
322 | } |
323 | |
324 | /** |
325 | * @param string $name |
326 | * @param mixed $value |
327 | */ |
328 | public function __set( string $name, $value ): void { |
329 | '@phan-var \Wikimedia\IDLeDOM\HTMLBodyElement $this'; |
330 | // @var \Wikimedia\IDLeDOM\HTMLBodyElement $this |
331 | switch ( $name ) { |
332 | case "nodeValue": |
333 | $this->setNodeValue( $value ); |
334 | return; |
335 | case "textContent": |
336 | $this->setTextContent( $value ); |
337 | return; |
338 | case "innerHTML": |
339 | $this->setInnerHTML( $value ); |
340 | return; |
341 | case "id": |
342 | $this->setId( $value ); |
343 | return; |
344 | case "className": |
345 | $this->setClassName( $value ); |
346 | return; |
347 | case "classList": |
348 | $this->setClassList( $value ); |
349 | return; |
350 | case "slot": |
351 | $this->setSlot( $value ); |
352 | return; |
353 | case "outerHTML": |
354 | $this->setOuterHTML( $value ); |
355 | return; |
356 | case "style": |
357 | $this->setStyle( $value ); |
358 | return; |
359 | case "contentEditable": |
360 | $this->setContentEditable( $value ); |
361 | return; |
362 | case "enterKeyHint": |
363 | $this->setEnterKeyHint( $value ); |
364 | return; |
365 | case "inputMode": |
366 | $this->setInputMode( $value ); |
367 | return; |
368 | case "onload": |
369 | $this->setOnload( $value ); |
370 | return; |
371 | case "nonce": |
372 | $this->setNonce( $value ); |
373 | return; |
374 | case "tabIndex": |
375 | $this->setTabIndex( $value ); |
376 | return; |
377 | case "title": |
378 | $this->setTitle( $value ); |
379 | return; |
380 | case "lang": |
381 | $this->setLang( $value ); |
382 | return; |
383 | case "translate": |
384 | $this->setTranslate( $value ); |
385 | return; |
386 | case "dir": |
387 | $this->setDir( $value ); |
388 | return; |
389 | case "hidden": |
390 | $this->setHidden( $value ); |
391 | return; |
392 | case "accessKey": |
393 | $this->setAccessKey( $value ); |
394 | return; |
395 | case "draggable": |
396 | $this->setDraggable( $value ); |
397 | return; |
398 | case "spellcheck": |
399 | $this->setSpellcheck( $value ); |
400 | return; |
401 | case "autocapitalize": |
402 | $this->setAutocapitalize( $value ); |
403 | return; |
404 | case "innerText": |
405 | $this->setInnerText( $value ); |
406 | return; |
407 | case "text": |
408 | $this->setText( $value ); |
409 | return; |
410 | case "link": |
411 | $this->setLink( $value ); |
412 | return; |
413 | case "vLink": |
414 | $this->setVLink( $value ); |
415 | return; |
416 | case "aLink": |
417 | $this->setALink( $value ); |
418 | return; |
419 | case "bgColor": |
420 | $this->setBgColor( $value ); |
421 | return; |
422 | case "background": |
423 | $this->setBackground( $value ); |
424 | return; |
425 | default: |
426 | break; |
427 | } |
428 | '@phan-var \Wikimedia\IDLeDOM\Helper\HTMLBodyElement $this'; |
429 | // @var \Wikimedia\IDLeDOM\Helper\HTMLBodyElement $this |
430 | $this->_setMissingProp( $name, $value ); |
431 | } |
432 | |
433 | /** |
434 | * @param string $name |
435 | */ |
436 | public function __unset( string $name ): void { |
437 | '@phan-var \Wikimedia\IDLeDOM\HTMLBodyElement $this'; |
438 | // @var \Wikimedia\IDLeDOM\HTMLBodyElement $this |
439 | switch ( $name ) { |
440 | case "nodeType": |
441 | break; |
442 | case "nodeName": |
443 | break; |
444 | case "baseURI": |
445 | break; |
446 | case "isConnected": |
447 | break; |
448 | case "ownerDocument": |
449 | break; |
450 | case "parentNode": |
451 | break; |
452 | case "parentElement": |
453 | break; |
454 | case "childNodes": |
455 | break; |
456 | case "firstChild": |
457 | break; |
458 | case "lastChild": |
459 | break; |
460 | case "previousSibling": |
461 | break; |
462 | case "nextSibling": |
463 | break; |
464 | case "nodeValue": |
465 | $this->setNodeValue( null ); |
466 | return; |
467 | case "textContent": |
468 | $this->setTextContent( null ); |
469 | return; |
470 | case "innerHTML": |
471 | break; |
472 | case "previousElementSibling": |
473 | break; |
474 | case "nextElementSibling": |
475 | break; |
476 | case "children": |
477 | break; |
478 | case "firstElementChild": |
479 | break; |
480 | case "lastElementChild": |
481 | break; |
482 | case "childElementCount": |
483 | break; |
484 | case "assignedSlot": |
485 | break; |
486 | case "namespaceURI": |
487 | break; |
488 | case "prefix": |
489 | break; |
490 | case "localName": |
491 | break; |
492 | case "tagName": |
493 | break; |
494 | case "id": |
495 | break; |
496 | case "className": |
497 | break; |
498 | case "classList": |
499 | break; |
500 | case "slot": |
501 | break; |
502 | case "attributes": |
503 | break; |
504 | case "shadowRoot": |
505 | break; |
506 | case "outerHTML": |
507 | break; |
508 | case "style": |
509 | break; |
510 | case "contentEditable": |
511 | break; |
512 | case "enterKeyHint": |
513 | break; |
514 | case "isContentEditable": |
515 | break; |
516 | case "inputMode": |
517 | break; |
518 | case "onload": |
519 | break; |
520 | case "dataset": |
521 | break; |
522 | case "nonce": |
523 | break; |
524 | case "tabIndex": |
525 | break; |
526 | case "title": |
527 | break; |
528 | case "lang": |
529 | break; |
530 | case "translate": |
531 | break; |
532 | case "dir": |
533 | break; |
534 | case "hidden": |
535 | break; |
536 | case "accessKey": |
537 | break; |
538 | case "accessKeyLabel": |
539 | break; |
540 | case "draggable": |
541 | break; |
542 | case "spellcheck": |
543 | break; |
544 | case "autocapitalize": |
545 | break; |
546 | case "innerText": |
547 | break; |
548 | case "offsetParent": |
549 | break; |
550 | case "offsetTop": |
551 | break; |
552 | case "offsetLeft": |
553 | break; |
554 | case "offsetWidth": |
555 | break; |
556 | case "offsetHeight": |
557 | break; |
558 | case "text": |
559 | break; |
560 | case "link": |
561 | break; |
562 | case "vLink": |
563 | break; |
564 | case "aLink": |
565 | break; |
566 | case "bgColor": |
567 | break; |
568 | case "background": |
569 | break; |
570 | default: |
571 | return; |
572 | } |
573 | $trace = debug_backtrace(); |
574 | while ( |
575 | count( $trace ) > 0 && |
576 | $trace[0]['function'] !== "__unset" |
577 | ) { |
578 | array_shift( $trace ); |
579 | } |
580 | trigger_error( |
581 | 'Undefined property' . |
582 | ' via ' . ( $trace[0]['function'] ?? '' ) . '(): ' . $name . |
583 | ' in ' . ( $trace[0]['file'] ?? '' ) . |
584 | ' on line ' . ( $trace[0]['line'] ?? '' ), |
585 | E_USER_NOTICE |
586 | ); |
587 | } |
588 | |
589 | /** |
590 | * @return string |
591 | */ |
592 | public function getText(): string { |
593 | '@phan-var \Wikimedia\IDLeDOM\Element $this'; |
594 | // @var \Wikimedia\IDLeDOM\Element $this |
595 | return $this->getAttribute( 'text' ) ?? ''; |
596 | } |
597 | |
598 | /** |
599 | * @param ?string $val |
600 | */ |
601 | public function setText( ?string $val ): void { |
602 | '@phan-var \Wikimedia\IDLeDOM\Element $this'; |
603 | // @var \Wikimedia\IDLeDOM\Element $this |
604 | $this->setAttribute( 'text', $val ?? '' ); |
605 | } |
606 | |
607 | /** |
608 | * @return string |
609 | */ |
610 | public function getLink(): string { |
611 | '@phan-var \Wikimedia\IDLeDOM\Element $this'; |
612 | // @var \Wikimedia\IDLeDOM\Element $this |
613 | return $this->getAttribute( 'link' ) ?? ''; |
614 | } |
615 | |
616 | /** |
617 | * @param ?string $val |
618 | */ |
619 | public function setLink( ?string $val ): void { |
620 | '@phan-var \Wikimedia\IDLeDOM\Element $this'; |
621 | // @var \Wikimedia\IDLeDOM\Element $this |
622 | $this->setAttribute( 'link', $val ?? '' ); |
623 | } |
624 | |
625 | /** |
626 | * @return string |
627 | */ |
628 | public function getVLink(): string { |
629 | '@phan-var \Wikimedia\IDLeDOM\Element $this'; |
630 | // @var \Wikimedia\IDLeDOM\Element $this |
631 | return $this->getAttribute( 'vlink' ) ?? ''; |
632 | } |
633 | |
634 | /** |
635 | * @param ?string $val |
636 | */ |
637 | public function setVLink( ?string $val ): void { |
638 | '@phan-var \Wikimedia\IDLeDOM\Element $this'; |
639 | // @var \Wikimedia\IDLeDOM\Element $this |
640 | $this->setAttribute( 'vlink', $val ?? '' ); |
641 | } |
642 | |
643 | /** |
644 | * @return string |
645 | */ |
646 | public function getALink(): string { |
647 | '@phan-var \Wikimedia\IDLeDOM\Element $this'; |
648 | // @var \Wikimedia\IDLeDOM\Element $this |
649 | return $this->getAttribute( 'alink' ) ?? ''; |
650 | } |
651 | |
652 | /** |
653 | * @param ?string $val |
654 | */ |
655 | public function setALink( ?string $val ): void { |
656 | '@phan-var \Wikimedia\IDLeDOM\Element $this'; |
657 | // @var \Wikimedia\IDLeDOM\Element $this |
658 | $this->setAttribute( 'alink', $val ?? '' ); |
659 | } |
660 | |
661 | /** |
662 | * @return string |
663 | */ |
664 | public function getBgColor(): string { |
665 | '@phan-var \Wikimedia\IDLeDOM\Element $this'; |
666 | // @var \Wikimedia\IDLeDOM\Element $this |
667 | return $this->getAttribute( 'bgcolor' ) ?? ''; |
668 | } |
669 | |
670 | /** |
671 | * @param ?string $val |
672 | */ |
673 | public function setBgColor( ?string $val ): void { |
674 | '@phan-var \Wikimedia\IDLeDOM\Element $this'; |
675 | // @var \Wikimedia\IDLeDOM\Element $this |
676 | $this->setAttribute( 'bgcolor', $val ?? '' ); |
677 | } |
678 | |
679 | /** |
680 | * @return string |
681 | */ |
682 | public function getBackground(): string { |
683 | '@phan-var \Wikimedia\IDLeDOM\Element $this'; |
684 | // @var \Wikimedia\IDLeDOM\Element $this |
685 | return $this->getAttribute( 'background' ) ?? ''; |
686 | } |
687 | |
688 | /** |
689 | * @param string $val |
690 | */ |
691 | public function setBackground( string $val ): void { |
692 | '@phan-var \Wikimedia\IDLeDOM\Element $this'; |
693 | // @var \Wikimedia\IDLeDOM\Element $this |
694 | $this->setAttribute( 'background', $val ); |
695 | } |
696 | |
697 | } |