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