Code Coverage
 
Lines
Functions and Methods
Classes and Traits
Total
0.00% covered (danger)
0.00%
0 / 78
0.00% covered (danger)
0.00%
0 / 4
CRAP
0.00% covered (danger)
0.00%
0 / 1
TextTrackCue
0.00% covered (danger)
0.00%
0 / 78
0.00% covered (danger)
0.00%
0 / 4
1406
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 / 16
0.00% covered (danger)
0.00%
0 / 1
90
 __isset
0.00% covered (danger)
0.00%
0 / 16
0.00% covered (danger)
0.00%
0 / 1
90
 __set
0.00% covered (danger)
0.00%
0 / 20
0.00% covered (danger)
0.00%
0 / 1
72
 __unset
0.00% covered (danger)
0.00%
0 / 26
0.00% covered (danger)
0.00%
0 / 1
132
1<?php
2
3// AUTOMATICALLY GENERATED.  DO NOT EDIT.
4// Use `composer build` to regenerate.
5
6namespace Wikimedia\IDLeDOM\Helper;
7
8trait TextTrackCue {
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\TextTrackCue $this';
44        // @var \Wikimedia\IDLeDOM\TextTrackCue $this
45        switch ( $name ) {
46            case "track":
47                return $this->getTrack();
48            case "id":
49                return $this->getId();
50            case "startTime":
51                return $this->getStartTime();
52            case "endTime":
53                return $this->getEndTime();
54            case "pauseOnExit":
55                return $this->getPauseOnExit();
56            case "onenter":
57                return $this->getOnenter();
58            case "onexit":
59                return $this->getOnexit();
60            default:
61                break;
62        }
63        '@phan-var \Wikimedia\IDLeDOM\Helper\TextTrackCue $this';
64        // @var \Wikimedia\IDLeDOM\Helper\TextTrackCue $this
65        return $this->_getMissingProp( $name );
66    }
67
68    /**
69     * @param string $name
70     * @return bool
71     */
72    public function __isset( string $name ): bool {
73        '@phan-var \Wikimedia\IDLeDOM\TextTrackCue $this';
74        // @var \Wikimedia\IDLeDOM\TextTrackCue $this
75        switch ( $name ) {
76            case "track":
77                return $this->getTrack() !== null;
78            case "id":
79                return true;
80            case "startTime":
81                return true;
82            case "endTime":
83                return true;
84            case "pauseOnExit":
85                return true;
86            case "onenter":
87                return true;
88            case "onexit":
89                return true;
90            default:
91                break;
92        }
93        return false;
94    }
95
96    /**
97     * @param string $name
98     * @param mixed $value
99     */
100    public function __set( string $name, $value ): void {
101        '@phan-var \Wikimedia\IDLeDOM\TextTrackCue $this';
102        // @var \Wikimedia\IDLeDOM\TextTrackCue $this
103        switch ( $name ) {
104            case "id":
105                $this->setId( $value );
106                return;
107            case "startTime":
108                $this->setStartTime( $value );
109                return;
110            case "endTime":
111                $this->setEndTime( $value );
112                return;
113            case "pauseOnExit":
114                $this->setPauseOnExit( $value );
115                return;
116            case "onenter":
117                $this->setOnenter( $value );
118                return;
119            case "onexit":
120                $this->setOnexit( $value );
121                return;
122            default:
123                break;
124        }
125        '@phan-var \Wikimedia\IDLeDOM\Helper\TextTrackCue $this';
126        // @var \Wikimedia\IDLeDOM\Helper\TextTrackCue $this
127        $this->_setMissingProp( $name, $value );
128    }
129
130    /**
131     * @param string $name
132     */
133    public function __unset( string $name ): void {
134        '@phan-var \Wikimedia\IDLeDOM\TextTrackCue $this';
135        // @var \Wikimedia\IDLeDOM\TextTrackCue $this
136        switch ( $name ) {
137            case "track":
138                break;
139            case "id":
140                break;
141            case "startTime":
142                break;
143            case "endTime":
144                break;
145            case "pauseOnExit":
146                break;
147            case "onenter":
148                break;
149            case "onexit":
150                break;
151            default:
152                return;
153        }
154        $trace = debug_backtrace();
155        while (
156            count( $trace ) > 0 &&
157            $trace[0]['function'] !== "__unset"
158        ) {
159            array_shift( $trace );
160        }
161        trigger_error(
162            'Undefined property' .
163            ' via ' . ( $trace[0]['function'] ?? '' ) . '(): ' . $name .
164            ' in ' . ( $trace[0]['file'] ?? '' ) .
165            ' on line ' . ( $trace[0]['line'] ?? '' ),
166            E_USER_NOTICE
167        );
168    }
169
170}