Debian Codegraph @

vendor/wikimedia/idle-dom/src/Helper/TextTrack.php

raw
1 <?php
2
3 // AUTOMATICALLY GENERATED. DO NOT EDIT.
4 // Use `composer build` to regenerate.
5
6 namespace Wikimedia\IDLeDOM\Helper;
7
8 trait TextTrack {
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\TextTrack $this';
44 // @var \Wikimedia\IDLeDOM\TextTrack $this
45 switch ( $name ) {
46 case "kind":
47 return $this->getKind();
48 case "label":
49 return $this->getLabel();
50 case "language":
51 return $this->getLanguage();
52 case "id":
53 return $this->getId();
54 case "inBandMetadataTrackDispatchType":
55 return $this->getInBandMetadataTrackDispatchType();
56 case "cues":
57 return $this->getCues();
58 case "activeCues":
59 return $this->getActiveCues();
60 case "oncuechange":
61 return $this->getOncuechange();
62 default:
63 break;
64 }
65 '@phan-var \Wikimedia\IDLeDOM\Helper\TextTrack $this';
66 // @var \Wikimedia\IDLeDOM\Helper\TextTrack $this
67 return $this->_getMissingProp( $name );
68 }
69
70 /**
71 * @param string $name
72 * @return bool
73 */
74 public function __isset( string $name ): bool {
75 '@phan-var \Wikimedia\IDLeDOM\TextTrack $this';
76 // @var \Wikimedia\IDLeDOM\TextTrack $this
77 switch ( $name ) {
78 case "kind":
79 return true;
80 case "label":
81 return true;
82 case "language":
83 return true;
84 case "id":
85 return true;
86 case "inBandMetadataTrackDispatchType":
87 return true;
88 case "cues":
89 return $this->getCues() !== null;
90 case "activeCues":
91 return $this->getActiveCues() !== null;
92 case "oncuechange":
93 return true;
94 default:
95 break;
96 }
97 return false;
98 }
99
100 /**
101 * @param string $name
102 * @param mixed $value
103 */
104 public function __set( string $name, $value ): void {
105 '@phan-var \Wikimedia\IDLeDOM\TextTrack $this';
106 // @var \Wikimedia\IDLeDOM\TextTrack $this
107 switch ( $name ) {
108 case "oncuechange":
109 $this->setOncuechange( $value );
110 return;
111 default:
112 break;
113 }
114 '@phan-var \Wikimedia\IDLeDOM\Helper\TextTrack $this';
115 // @var \Wikimedia\IDLeDOM\Helper\TextTrack $this
116 $this->_setMissingProp( $name, $value );
117 }
118
119 /**
120 * @param string $name
121 */
122 public function __unset( string $name ): void {
123 '@phan-var \Wikimedia\IDLeDOM\TextTrack $this';
124 // @var \Wikimedia\IDLeDOM\TextTrack $this
125 switch ( $name ) {
126 case "kind":
127 break;
128 case "label":
129 break;
130 case "language":
131 break;
132 case "id":
133 break;
134 case "inBandMetadataTrackDispatchType":
135 break;
136 case "cues":
137 break;
138 case "activeCues":
139 break;
140 case "oncuechange":
141 break;
142 default:
143 return;
144 }
145 $trace = debug_backtrace();
146 while (
147 count( $trace ) > 0 &&
148 $trace[0]['function'] !== "__unset"
149 ) {
150 array_shift( $trace );
151 }
152 trigger_error(
153 'Undefined property' .
154 ' via ' . ( $trace[0]['function'] ?? '' ) . '(): ' . $name .
155 ' in ' . ( $trace[0]['file'] ?? '' ) .
156 ' on line ' . ( $trace[0]['line'] ?? '' ),
157 E_USER_NOTICE
158 );
159 }
160
161 }