Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
Total | |
0.00% |
0 / 74 |
|
0.00% |
0 / 6 |
CRAP | |
0.00% |
0 / 1 |
AudioTrack | |
0.00% |
0 / 74 |
|
0.00% |
0 / 6 |
1056 | |
0.00% |
0 / 1 |
_getMissingProp | |
0.00% |
0 / 12 |
|
0.00% |
0 / 1 |
12 | |||
_setMissingProp | |
0.00% |
0 / 11 |
|
0.00% |
0 / 1 |
12 | |||
__get | |
0.00% |
0 / 12 |
|
0.00% |
0 / 1 |
56 | |||
__isset | |
0.00% |
0 / 12 |
|
0.00% |
0 / 1 |
56 | |||
__set | |
0.00% |
0 / 5 |
|
0.00% |
0 / 1 |
12 | |||
__unset | |
0.00% |
0 / 22 |
|
0.00% |
0 / 1 |
90 |
1 | <?php |
2 | |
3 | // AUTOMATICALLY GENERATED. DO NOT EDIT. |
4 | // Use `composer build` to regenerate. |
5 | |
6 | namespace Wikimedia\IDLeDOM\Helper; |
7 | |
8 | trait AudioTrack { |
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 | protected function _getMissingProp( string $prop ) { |
24 | $trace = debug_backtrace(); |
25 | while ( |
26 | count( $trace ) > 0 && |
27 | $trace[0]['function'] !== "__get" |
28 | ) { |
29 | array_shift( $trace ); |
30 | } |
31 | trigger_error( |
32 | 'Undefined property' . |
33 | ' via ' . ( $trace[0]['function'] ?? '' ) . '(): ' . $prop . |
34 | ' in ' . ( $trace[0]['file'] ?? '' ) . |
35 | ' on line ' . ( $trace[0]['line'] ?? '' ), |
36 | E_USER_NOTICE |
37 | ); |
38 | return null; |
39 | } |
40 | |
41 | /** |
42 | * Handle an attempt to set a non-existing property on this |
43 | * object. The default implementation raises an exception |
44 | * but the implementor can choose a different behavior: |
45 | * ignore the operation (like JavaScript), dynamically create |
46 | * the property, etc. |
47 | * @param string $prop the name of the property requested |
48 | * @param mixed $value the value to set |
49 | */ |
50 | protected function _setMissingProp( string $prop, $value ): void { |
51 | $trace = debug_backtrace(); |
52 | while ( |
53 | count( $trace ) > 0 && |
54 | $trace[0]['function'] !== "__set" |
55 | ) { |
56 | array_shift( $trace ); |
57 | } |
58 | trigger_error( |
59 | 'Undefined property' . |
60 | ' via ' . ( $trace[0]['function'] ?? '' ) . '(): ' . $prop . |
61 | ' in ' . ( $trace[0]['file'] ?? '' ) . |
62 | ' on line ' . ( $trace[0]['line'] ?? '' ), |
63 | E_USER_NOTICE |
64 | ); |
65 | } |
66 | |
67 | // phpcs:enable |
68 | |
69 | /** |
70 | * @param string $name |
71 | * @return mixed |
72 | */ |
73 | public function __get( string $name ) { |
74 | '@phan-var \Wikimedia\IDLeDOM\AudioTrack $this'; |
75 | // @var \Wikimedia\IDLeDOM\AudioTrack $this |
76 | switch ( $name ) { |
77 | case "id": |
78 | return $this->getId(); |
79 | case "kind": |
80 | return $this->getKind(); |
81 | case "label": |
82 | return $this->getLabel(); |
83 | case "language": |
84 | return $this->getLanguage(); |
85 | case "enabled": |
86 | return $this->getEnabled(); |
87 | default: |
88 | break; |
89 | } |
90 | '@phan-var \Wikimedia\IDLeDOM\Helper\AudioTrack $this'; |
91 | // @var \Wikimedia\IDLeDOM\Helper\AudioTrack $this |
92 | return $this->_getMissingProp( $name ); |
93 | } |
94 | |
95 | /** |
96 | * @param string $name |
97 | * @return bool |
98 | */ |
99 | public function __isset( string $name ): bool { |
100 | '@phan-var \Wikimedia\IDLeDOM\AudioTrack $this'; |
101 | // @var \Wikimedia\IDLeDOM\AudioTrack $this |
102 | switch ( $name ) { |
103 | case "id": |
104 | return true; |
105 | case "kind": |
106 | return true; |
107 | case "label": |
108 | return true; |
109 | case "language": |
110 | return true; |
111 | case "enabled": |
112 | return true; |
113 | default: |
114 | break; |
115 | } |
116 | return false; |
117 | } |
118 | |
119 | /** |
120 | * @param string $name |
121 | * @param mixed $value |
122 | */ |
123 | public function __set( string $name, $value ): void { |
124 | '@phan-var \Wikimedia\IDLeDOM\AudioTrack $this'; |
125 | // @var \Wikimedia\IDLeDOM\AudioTrack $this |
126 | switch ( $name ) { |
127 | case "enabled": |
128 | $this->setEnabled( $value ); |
129 | return; |
130 | default: |
131 | break; |
132 | } |
133 | '@phan-var \Wikimedia\IDLeDOM\Helper\AudioTrack $this'; |
134 | // @var \Wikimedia\IDLeDOM\Helper\AudioTrack $this |
135 | $this->_setMissingProp( $name, $value ); |
136 | } |
137 | |
138 | /** |
139 | * @param string $name |
140 | */ |
141 | public function __unset( string $name ): void { |
142 | '@phan-var \Wikimedia\IDLeDOM\AudioTrack $this'; |
143 | // @var \Wikimedia\IDLeDOM\AudioTrack $this |
144 | switch ( $name ) { |
145 | case "id": |
146 | break; |
147 | case "kind": |
148 | break; |
149 | case "label": |
150 | break; |
151 | case "language": |
152 | break; |
153 | case "enabled": |
154 | break; |
155 | default: |
156 | return; |
157 | } |
158 | $trace = debug_backtrace(); |
159 | while ( |
160 | count( $trace ) > 0 && |
161 | $trace[0]['function'] !== "__unset" |
162 | ) { |
163 | array_shift( $trace ); |
164 | } |
165 | trigger_error( |
166 | 'Undefined property' . |
167 | ' via ' . ( $trace[0]['function'] ?? '' ) . '(): ' . $name . |
168 | ' in ' . ( $trace[0]['file'] ?? '' ) . |
169 | ' on line ' . ( $trace[0]['line'] ?? '' ), |
170 | E_USER_NOTICE |
171 | ); |
172 | } |
173 | |
174 | } |