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