Code Coverage
 
Lines
Functions and Methods
Classes and Traits
Total
0.00% covered (danger)
0.00%
0 / 514
0.00% covered (danger)
0.00%
0 / 12
CRAP
0.00% covered (danger)
0.00%
0 / 1
HTMLTrackElement
0.00% covered (danger)
0.00%
0 / 514
0.00% covered (danger)
0.00%
0 / 12
61752
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 / 130
0.00% covered (danger)
0.00%
0 / 1
4422
 __isset
0.00% covered (danger)
0.00%
0 / 130
0.00% covered (danger)
0.00%
0 / 1
4422
 __set
0.00% covered (danger)
0.00%
0 / 92
0.00% covered (danger)
0.00%
0 / 1
1056
 __unset
0.00% covered (danger)
0.00%
0 / 142
0.00% covered (danger)
0.00%
0 / 1
4692
 getKind
0.00% covered (danger)
0.00%
0 / 11
0.00% covered (danger)
0.00%
0 / 1
72
 setKind
0.00% covered (danger)
0.00%
0 / 1
0.00% covered (danger)
0.00%
0 / 1
2
 getSrclang
0.00% covered (danger)
0.00%
0 / 1
0.00% covered (danger)
0.00%
0 / 1
2
 setSrclang
0.00% covered (danger)
0.00%
0 / 1
0.00% covered (danger)
0.00%
0 / 1
2
 getLabel
0.00% covered (danger)
0.00%
0 / 1
0.00% covered (danger)
0.00%
0 / 1
2
 setLabel
0.00% covered (danger)
0.00%
0 / 1
0.00% covered (danger)
0.00%
0 / 1
2
 getDefault
0.00% covered (danger)
0.00%
0 / 1
0.00% covered (danger)
0.00%
0 / 1
2
 setDefault
0.00% covered (danger)
0.00%
0 / 3
0.00% covered (danger)
0.00%
0 / 1
6
1<?php
2
3// AUTOMATICALLY GENERATED.  DO NOT EDIT.
4// Use `composer build` to regenerate.
5
6namespace Wikimedia\IDLeDOM\Helper;
7
8trait HTMLTrackElement {
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\HTMLTrackElement $this';
44        // @var \Wikimedia\IDLeDOM\HTMLTrackElement $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 "kind":
163                return $this->getKind();
164            case "src":
165                return $this->getSrc();
166            case "srclang":
167                return $this->getSrclang();
168            case "label":
169                return $this->getLabel();
170            case "default":
171                return $this->getDefault();
172            case "readyState":
173                return $this->getReadyState();
174            default:
175                break;
176        }
177        '@phan-var \Wikimedia\IDLeDOM\Helper\HTMLTrackElement $this';
178        // @var \Wikimedia\IDLeDOM\Helper\HTMLTrackElement $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\HTMLTrackElement $this';
188        // @var \Wikimedia\IDLeDOM\HTMLTrackElement $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 "kind":
307                return true;
308            case "src":
309                return true;
310            case "srclang":
311                return true;
312            case "label":
313                return true;
314            case "default":
315                return true;
316            case "readyState":
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\HTMLTrackElement $this';
330        // @var \Wikimedia\IDLeDOM\HTMLTrackElement $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 "kind":
408                $this->setKind( $value );
409                return;
410            case "src":
411                $this->setSrc( $value );
412                return;
413            case "srclang":
414                $this->setSrclang( $value );
415                return;
416            case "label":
417                $this->setLabel( $value );
418                return;
419            case "default":
420                $this->setDefault( $value );
421                return;
422            default:
423                break;
424        }
425        '@phan-var \Wikimedia\IDLeDOM\Helper\HTMLTrackElement $this';
426        // @var \Wikimedia\IDLeDOM\Helper\HTMLTrackElement $this
427        $this->_setMissingProp( $name, $value );
428    }
429
430    /**
431     * @param string $name
432     */
433    public function __unset( string $name ): void {
434        '@phan-var \Wikimedia\IDLeDOM\HTMLTrackElement $this';
435        // @var \Wikimedia\IDLeDOM\HTMLTrackElement $this
436        switch ( $name ) {
437            case "nodeType":
438                break;
439            case "nodeName":
440                break;
441            case "baseURI":
442                break;
443            case "isConnected":
444                break;
445            case "ownerDocument":
446                break;
447            case "parentNode":
448                break;
449            case "parentElement":
450                break;
451            case "childNodes":
452                break;
453            case "firstChild":
454                break;
455            case "lastChild":
456                break;
457            case "previousSibling":
458                break;
459            case "nextSibling":
460                break;
461            case "nodeValue":
462                $this->setNodeValue( null );
463                return;
464            case "textContent":
465                $this->setTextContent( null );
466                return;
467            case "innerHTML":
468                break;
469            case "previousElementSibling":
470                break;
471            case "nextElementSibling":
472                break;
473            case "children":
474                break;
475            case "firstElementChild":
476                break;
477            case "lastElementChild":
478                break;
479            case "childElementCount":
480                break;
481            case "assignedSlot":
482                break;
483            case "namespaceURI":
484                break;
485            case "prefix":
486                break;
487            case "localName":
488                break;
489            case "tagName":
490                break;
491            case "id":
492                break;
493            case "className":
494                break;
495            case "classList":
496                break;
497            case "slot":
498                break;
499            case "attributes":
500                break;
501            case "shadowRoot":
502                break;
503            case "outerHTML":
504                break;
505            case "style":
506                break;
507            case "contentEditable":
508                break;
509            case "enterKeyHint":
510                break;
511            case "isContentEditable":
512                break;
513            case "inputMode":
514                break;
515            case "onload":
516                break;
517            case "dataset":
518                break;
519            case "nonce":
520                break;
521            case "tabIndex":
522                break;
523            case "title":
524                break;
525            case "lang":
526                break;
527            case "translate":
528                break;
529            case "dir":
530                break;
531            case "hidden":
532                break;
533            case "accessKey":
534                break;
535            case "accessKeyLabel":
536                break;
537            case "draggable":
538                break;
539            case "spellcheck":
540                break;
541            case "autocapitalize":
542                break;
543            case "innerText":
544                break;
545            case "offsetParent":
546                break;
547            case "offsetTop":
548                break;
549            case "offsetLeft":
550                break;
551            case "offsetWidth":
552                break;
553            case "offsetHeight":
554                break;
555            case "kind":
556                break;
557            case "src":
558                break;
559            case "srclang":
560                break;
561            case "label":
562                break;
563            case "default":
564                break;
565            case "readyState":
566                break;
567            default:
568                return;
569        }
570        $trace = debug_backtrace();
571        while (
572            count( $trace ) > 0 &&
573            $trace[0]['function'] !== "__unset"
574        ) {
575            array_shift( $trace );
576        }
577        trigger_error(
578            'Undefined property' .
579            ' via ' . ( $trace[0]['function'] ?? '' ) . '(): ' . $name .
580            ' in ' . ( $trace[0]['file'] ?? '' ) .
581            ' on line ' . ( $trace[0]['line'] ?? '' ),
582            E_USER_NOTICE
583        );
584    }
585
586    /**
587     * @return string
588     */
589    public function getKind(): string {
590        '@phan-var \Wikimedia\IDLeDOM\Element $this';
591        // @var \Wikimedia\IDLeDOM\Element $this
592        $val = $this->getAttribute( 'kind' );
593        if ( $val !== null ) {
594            $val = strtr( $val, 'ABCDEFGHIJKLMNOPQRSTUVWXYZ', 'abcdefghijklmnopqrstuvwxyz' );
595            switch ( $val ) {
596                case 'subtitles':
597                case 'captions':
598                case 'descriptions':
599                case 'chapters':
600                case 'metadata':
601                    return $val;
602                default:
603                    return 'metadata';
604            }
605        }
606        return 'subtitles';
607    }
608
609    /**
610     * @param string $val
611     */
612    public function setKind( string $val ): void {
613        '@phan-var \Wikimedia\IDLeDOM\Element $this';
614        // @var \Wikimedia\IDLeDOM\Element $this
615        $this->setAttribute( 'kind', $val );
616    }
617
618    /**
619     * @return string
620     */
621    public function getSrclang(): string {
622        '@phan-var \Wikimedia\IDLeDOM\Element $this';
623        // @var \Wikimedia\IDLeDOM\Element $this
624        return $this->getAttribute( 'srclang' ) ?? '';
625    }
626
627    /**
628     * @param string $val
629     */
630    public function setSrclang( string $val ): void {
631        '@phan-var \Wikimedia\IDLeDOM\Element $this';
632        // @var \Wikimedia\IDLeDOM\Element $this
633        $this->setAttribute( 'srclang', $val );
634    }
635
636    /**
637     * @return string
638     */
639    public function getLabel(): string {
640        '@phan-var \Wikimedia\IDLeDOM\Element $this';
641        // @var \Wikimedia\IDLeDOM\Element $this
642        return $this->getAttribute( 'label' ) ?? '';
643    }
644
645    /**
646     * @param string $val
647     */
648    public function setLabel( string $val ): void {
649        '@phan-var \Wikimedia\IDLeDOM\Element $this';
650        // @var \Wikimedia\IDLeDOM\Element $this
651        $this->setAttribute( 'label', $val );
652    }
653
654    /**
655     * @return bool
656     */
657    public function getDefault(): bool {
658        '@phan-var \Wikimedia\IDLeDOM\Element $this';
659        // @var \Wikimedia\IDLeDOM\Element $this
660        return $this->hasAttribute( 'default' );
661    }
662
663    /**
664     * @param bool $val
665     */
666    public function setDefault( bool $val ): void {
667        '@phan-var \Wikimedia\IDLeDOM\Element $this';
668        // @var \Wikimedia\IDLeDOM\Element $this
669        if ( $val ) {
670            $this->setAttribute( 'default', '' );
671        } else {
672            $this->removeAttribute( 'default' );
673        }
674    }
675
676}