Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
Total | |
0.00% |
0 / 106 |
|
0.00% |
0 / 8 |
CRAP | |
0.00% |
0 / 1 |
VideoTrackList | |
0.00% |
0 / 106 |
|
0.00% |
0 / 8 |
2352 | |
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 / 12 |
|
0.00% |
0 / 1 |
56 | |||
__isset | |
0.00% |
0 / 12 |
|
0.00% |
0 / 1 |
56 | |||
__set | |
0.00% |
0 / 11 |
|
0.00% |
0 / 1 |
30 | |||
__unset | |
0.00% |
0 / 22 |
|
0.00% |
0 / 1 |
90 | |||
offsetExists | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
offsetGet | |
0.00% |
0 / 22 |
|
0.00% |
0 / 1 |
90 | |||
offsetSet | |
0.00% |
0 / 13 |
|
0.00% |
0 / 1 |
30 | |||
offsetUnset | |
0.00% |
0 / 13 |
|
0.00% |
0 / 1 |
30 |
1 | <?php |
2 | |
3 | // AUTOMATICALLY GENERATED. DO NOT EDIT. |
4 | // Use `composer build` to regenerate. |
5 | |
6 | namespace Wikimedia\IDLeDOM\Helper; |
7 | |
8 | trait VideoTrackList { |
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\VideoTrackList $this'; |
44 | // @var \Wikimedia\IDLeDOM\VideoTrackList $this |
45 | switch ( $name ) { |
46 | case "length": |
47 | return $this->getLength(); |
48 | case "selectedIndex": |
49 | return $this->getSelectedIndex(); |
50 | case "onchange": |
51 | return $this->getOnchange(); |
52 | case "onaddtrack": |
53 | return $this->getOnaddtrack(); |
54 | case "onremovetrack": |
55 | return $this->getOnremovetrack(); |
56 | default: |
57 | break; |
58 | } |
59 | '@phan-var \Wikimedia\IDLeDOM\Helper\VideoTrackList $this'; |
60 | // @var \Wikimedia\IDLeDOM\Helper\VideoTrackList $this |
61 | return $this->_getMissingProp( $name ); |
62 | } |
63 | |
64 | /** |
65 | * @param string $name |
66 | * @return bool |
67 | */ |
68 | public function __isset( string $name ): bool { |
69 | '@phan-var \Wikimedia\IDLeDOM\VideoTrackList $this'; |
70 | // @var \Wikimedia\IDLeDOM\VideoTrackList $this |
71 | switch ( $name ) { |
72 | case "length": |
73 | return true; |
74 | case "selectedIndex": |
75 | return true; |
76 | case "onchange": |
77 | return true; |
78 | case "onaddtrack": |
79 | return true; |
80 | case "onremovetrack": |
81 | return true; |
82 | default: |
83 | break; |
84 | } |
85 | return false; |
86 | } |
87 | |
88 | /** |
89 | * @param string $name |
90 | * @param mixed $value |
91 | */ |
92 | public function __set( string $name, $value ): void { |
93 | '@phan-var \Wikimedia\IDLeDOM\VideoTrackList $this'; |
94 | // @var \Wikimedia\IDLeDOM\VideoTrackList $this |
95 | switch ( $name ) { |
96 | case "onchange": |
97 | $this->setOnchange( $value ); |
98 | return; |
99 | case "onaddtrack": |
100 | $this->setOnaddtrack( $value ); |
101 | return; |
102 | case "onremovetrack": |
103 | $this->setOnremovetrack( $value ); |
104 | return; |
105 | default: |
106 | break; |
107 | } |
108 | '@phan-var \Wikimedia\IDLeDOM\Helper\VideoTrackList $this'; |
109 | // @var \Wikimedia\IDLeDOM\Helper\VideoTrackList $this |
110 | $this->_setMissingProp( $name, $value ); |
111 | } |
112 | |
113 | /** |
114 | * @param string $name |
115 | */ |
116 | public function __unset( string $name ): void { |
117 | '@phan-var \Wikimedia\IDLeDOM\VideoTrackList $this'; |
118 | // @var \Wikimedia\IDLeDOM\VideoTrackList $this |
119 | switch ( $name ) { |
120 | case "length": |
121 | break; |
122 | case "selectedIndex": |
123 | break; |
124 | case "onchange": |
125 | break; |
126 | case "onaddtrack": |
127 | break; |
128 | case "onremovetrack": |
129 | break; |
130 | default: |
131 | return; |
132 | } |
133 | $trace = debug_backtrace(); |
134 | while ( |
135 | count( $trace ) > 0 && |
136 | $trace[0]['function'] !== "__unset" |
137 | ) { |
138 | array_shift( $trace ); |
139 | } |
140 | trigger_error( |
141 | 'Undefined property' . |
142 | ' via ' . ( $trace[0]['function'] ?? '' ) . '(): ' . $name . |
143 | ' in ' . ( $trace[0]['file'] ?? '' ) . |
144 | ' on line ' . ( $trace[0]['line'] ?? '' ), |
145 | E_USER_NOTICE |
146 | ); |
147 | } |
148 | |
149 | /** |
150 | * @param mixed $offset |
151 | * @return bool |
152 | */ |
153 | public function offsetExists( $offset ): bool { |
154 | return $this->offsetGet( $offset ) !== null; |
155 | } |
156 | |
157 | /** |
158 | * @param mixed $offset |
159 | * @return mixed |
160 | */ |
161 | #[\ReturnTypeWillChange] |
162 | public function offsetGet( $offset ) { |
163 | '@phan-var \Wikimedia\IDLeDOM\VideoTrackList $this'; |
164 | // @var \Wikimedia\IDLeDOM\VideoTrackList $this |
165 | if ( is_numeric( $offset ) ) { |
166 | return $this->item( $offset ); |
167 | } elseif ( is_string( $offset ) ) { |
168 | return $this->getTrackById( $offset ); |
169 | } |
170 | $trace = debug_backtrace(); |
171 | while ( |
172 | count( $trace ) > 0 && |
173 | $trace[0]['function'] !== "offsetGet" && |
174 | $trace[0]['function'] !== "offsetExists" |
175 | ) { |
176 | array_shift( $trace ); |
177 | } |
178 | while ( |
179 | count( $trace ) > 1 && ( |
180 | $trace[1]['function'] === "offsetGet" || |
181 | $trace[1]['function'] === "offsetExists" |
182 | ) ) { |
183 | array_shift( $trace ); |
184 | } |
185 | trigger_error( |
186 | 'Undefined property' . |
187 | ' via ' . ( $trace[0]['function'] ?? '' ) . '(): ' . $offset . |
188 | ' in ' . ( $trace[0]['file'] ?? '' ) . |
189 | ' on line ' . ( $trace[0]['line'] ?? '' ), |
190 | E_USER_NOTICE |
191 | ); |
192 | return null; |
193 | } |
194 | |
195 | /** |
196 | * @param mixed $offset |
197 | * @param mixed $value |
198 | */ |
199 | public function offsetSet( $offset, $value ): void { |
200 | '@phan-var \Wikimedia\IDLeDOM\VideoTrackList $this'; |
201 | // @var \Wikimedia\IDLeDOM\VideoTrackList $this |
202 | if ( is_numeric( $offset ) ) { |
203 | /* Fall through */ |
204 | } elseif ( is_string( $offset ) ) { |
205 | /* Fall through */ |
206 | } |
207 | $trace = debug_backtrace(); |
208 | while ( |
209 | count( $trace ) > 0 && |
210 | $trace[0]['function'] !== "offsetSet" |
211 | ) { |
212 | array_shift( $trace ); |
213 | } |
214 | trigger_error( |
215 | 'Undefined property' . |
216 | ' via ' . ( $trace[0]['function'] ?? '' ) . '(): ' . $offset . |
217 | ' in ' . ( $trace[0]['file'] ?? '' ) . |
218 | ' on line ' . ( $trace[0]['line'] ?? '' ), |
219 | E_USER_NOTICE |
220 | ); |
221 | } |
222 | |
223 | /** |
224 | * @param mixed $offset |
225 | */ |
226 | public function offsetUnset( $offset ): void { |
227 | '@phan-var \Wikimedia\IDLeDOM\VideoTrackList $this'; |
228 | // @var \Wikimedia\IDLeDOM\VideoTrackList $this |
229 | if ( is_numeric( $offset ) ) { |
230 | /* Fall through */ |
231 | } elseif ( is_string( $offset ) ) { |
232 | /* Fall through */ |
233 | } |
234 | $trace = debug_backtrace(); |
235 | while ( |
236 | count( $trace ) > 0 && |
237 | $trace[0]['function'] !== "offsetUnset" |
238 | ) { |
239 | array_shift( $trace ); |
240 | } |
241 | trigger_error( |
242 | 'Undefined property' . |
243 | ' via ' . ( $trace[0]['function'] ?? '' ) . '(): ' . $offset . |
244 | ' in ' . ( $trace[0]['file'] ?? '' ) . |
245 | ' on line ' . ( $trace[0]['line'] ?? '' ), |
246 | E_USER_NOTICE |
247 | ); |
248 | } |
249 | |
250 | } |