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