Code Coverage
 
Lines
Functions and Methods
Classes and Traits
Total
0.00% covered (danger)
0.00%
0 / 170
0.00% covered (danger)
0.00%
0 / 4
CRAP
0.00% covered (danger)
0.00%
0 / 1
ShadowRoot
0.00% covered (danger)
0.00%
0 / 170
0.00% covered (danger)
0.00%
0 / 4
6972
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 / 48
0.00% covered (danger)
0.00%
0 / 1
650
 __isset
0.00% covered (danger)
0.00%
0 / 48
0.00% covered (danger)
0.00%
0 / 1
650
 __set
0.00% covered (danger)
0.00%
0 / 14
0.00% covered (danger)
0.00%
0 / 1
42
 __unset
0.00% covered (danger)
0.00%
0 / 60
0.00% covered (danger)
0.00%
0 / 1
756
1<?php
2
3// AUTOMATICALLY GENERATED.  DO NOT EDIT.
4// Use `composer build` to regenerate.
5
6namespace Wikimedia\IDLeDOM\Helper;
7
8trait ShadowRoot {
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\ShadowRoot $this';
44        // @var \Wikimedia\IDLeDOM\ShadowRoot $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 "children":
75                return $this->getChildren();
76            case "firstElementChild":
77                return $this->getFirstElementChild();
78            case "lastElementChild":
79                return $this->getLastElementChild();
80            case "childElementCount":
81                return $this->getChildElementCount();
82            case "styleSheets":
83                return $this->getStyleSheets();
84            case "innerHTML":
85                return $this->getInnerHTML();
86            case "mode":
87                return $this->getMode();
88            case "host":
89                return $this->getHost();
90            case "onslotchange":
91                return $this->getOnslotchange();
92            default:
93                break;
94        }
95        '@phan-var \Wikimedia\IDLeDOM\Helper\ShadowRoot $this';
96        // @var \Wikimedia\IDLeDOM\Helper\ShadowRoot $this
97        return $this->_getMissingProp( $name );
98    }
99
100    /**
101     * @param string $name
102     * @return bool
103     */
104    public function __isset( string $name ): bool {
105        '@phan-var \Wikimedia\IDLeDOM\ShadowRoot $this';
106        // @var \Wikimedia\IDLeDOM\ShadowRoot $this
107        switch ( $name ) {
108            case "nodeType":
109                return true;
110            case "nodeName":
111                return true;
112            case "baseURI":
113                return true;
114            case "isConnected":
115                return true;
116            case "ownerDocument":
117                return $this->getOwnerDocument() !== null;
118            case "parentNode":
119                return $this->getParentNode() !== null;
120            case "parentElement":
121                return $this->getParentElement() !== null;
122            case "childNodes":
123                return true;
124            case "firstChild":
125                return $this->getFirstChild() !== null;
126            case "lastChild":
127                return $this->getLastChild() !== null;
128            case "previousSibling":
129                return $this->getPreviousSibling() !== null;
130            case "nextSibling":
131                return $this->getNextSibling() !== null;
132            case "nodeValue":
133                return $this->getNodeValue() !== null;
134            case "textContent":
135                return $this->getTextContent() !== null;
136            case "children":
137                return true;
138            case "firstElementChild":
139                return $this->getFirstElementChild() !== null;
140            case "lastElementChild":
141                return $this->getLastElementChild() !== null;
142            case "childElementCount":
143                return true;
144            case "styleSheets":
145                return true;
146            case "innerHTML":
147                return true;
148            case "mode":
149                return true;
150            case "host":
151                return true;
152            case "onslotchange":
153                return true;
154            default:
155                break;
156        }
157        return false;
158    }
159
160    /**
161     * @param string $name
162     * @param mixed $value
163     */
164    public function __set( string $name, $value ): void {
165        '@phan-var \Wikimedia\IDLeDOM\ShadowRoot $this';
166        // @var \Wikimedia\IDLeDOM\ShadowRoot $this
167        switch ( $name ) {
168            case "nodeValue":
169                $this->setNodeValue( $value );
170                return;
171            case "textContent":
172                $this->setTextContent( $value );
173                return;
174            case "innerHTML":
175                $this->setInnerHTML( $value );
176                return;
177            case "onslotchange":
178                $this->setOnslotchange( $value );
179                return;
180            default:
181                break;
182        }
183        '@phan-var \Wikimedia\IDLeDOM\Helper\ShadowRoot $this';
184        // @var \Wikimedia\IDLeDOM\Helper\ShadowRoot $this
185        $this->_setMissingProp( $name, $value );
186    }
187
188    /**
189     * @param string $name
190     */
191    public function __unset( string $name ): void {
192        '@phan-var \Wikimedia\IDLeDOM\ShadowRoot $this';
193        // @var \Wikimedia\IDLeDOM\ShadowRoot $this
194        switch ( $name ) {
195            case "nodeType":
196                break;
197            case "nodeName":
198                break;
199            case "baseURI":
200                break;
201            case "isConnected":
202                break;
203            case "ownerDocument":
204                break;
205            case "parentNode":
206                break;
207            case "parentElement":
208                break;
209            case "childNodes":
210                break;
211            case "firstChild":
212                break;
213            case "lastChild":
214                break;
215            case "previousSibling":
216                break;
217            case "nextSibling":
218                break;
219            case "nodeValue":
220                $this->setNodeValue( null );
221                return;
222            case "textContent":
223                $this->setTextContent( null );
224                return;
225            case "children":
226                break;
227            case "firstElementChild":
228                break;
229            case "lastElementChild":
230                break;
231            case "childElementCount":
232                break;
233            case "styleSheets":
234                break;
235            case "innerHTML":
236                break;
237            case "mode":
238                break;
239            case "host":
240                break;
241            case "onslotchange":
242                break;
243            default:
244                return;
245        }
246        $trace = debug_backtrace();
247        while (
248            count( $trace ) > 0 &&
249            $trace[0]['function'] !== "__unset"
250        ) {
251            array_shift( $trace );
252        }
253        trigger_error(
254            'Undefined property' .
255            ' via ' . ( $trace[0]['function'] ?? '' ) . '(): ' . $name .
256            ' in ' . ( $trace[0]['file'] ?? '' ) .
257            ' on line ' . ( $trace[0]['line'] ?? '' ),
258            E_USER_NOTICE
259        );
260    }
261
262}