Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
Total | |
0.00% |
0 / 57 |
|
0.00% |
0 / 4 |
CRAP | |
0.00% |
0 / 1 |
CSSNamespaceRule | |
0.00% |
0 / 57 |
|
0.00% |
0 / 4 |
870 | |
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 / 14 |
|
0.00% |
0 / 1 |
72 | |||
__isset | |
0.00% |
0 / 14 |
|
0.00% |
0 / 1 |
72 | |||
__set | |
0.00% |
0 / 5 |
|
0.00% |
0 / 1 |
12 | |||
__unset | |
0.00% |
0 / 24 |
|
0.00% |
0 / 1 |
110 |
1 | <?php |
2 | |
3 | // AUTOMATICALLY GENERATED. DO NOT EDIT. |
4 | // Use `composer build` to regenerate. |
5 | |
6 | namespace Wikimedia\IDLeDOM\Helper; |
7 | |
8 | trait CSSNamespaceRule { |
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\CSSNamespaceRule $this'; |
44 | // @var \Wikimedia\IDLeDOM\CSSNamespaceRule $this |
45 | switch ( $name ) { |
46 | case "cssText": |
47 | return $this->getCssText(); |
48 | case "parentRule": |
49 | return $this->getParentRule(); |
50 | case "parentStyleSheet": |
51 | return $this->getParentStyleSheet(); |
52 | case "type": |
53 | return $this->getType(); |
54 | case "namespaceURI": |
55 | return $this->getNamespaceURI(); |
56 | case "prefix": |
57 | return $this->getPrefix(); |
58 | default: |
59 | break; |
60 | } |
61 | '@phan-var \Wikimedia\IDLeDOM\Helper\CSSNamespaceRule $this'; |
62 | // @var \Wikimedia\IDLeDOM\Helper\CSSNamespaceRule $this |
63 | return $this->_getMissingProp( $name ); |
64 | } |
65 | |
66 | /** |
67 | * @param string $name |
68 | * @return bool |
69 | */ |
70 | public function __isset( string $name ): bool { |
71 | '@phan-var \Wikimedia\IDLeDOM\CSSNamespaceRule $this'; |
72 | // @var \Wikimedia\IDLeDOM\CSSNamespaceRule $this |
73 | switch ( $name ) { |
74 | case "cssText": |
75 | return true; |
76 | case "parentRule": |
77 | return $this->getParentRule() !== null; |
78 | case "parentStyleSheet": |
79 | return $this->getParentStyleSheet() !== null; |
80 | case "type": |
81 | return true; |
82 | case "namespaceURI": |
83 | return true; |
84 | case "prefix": |
85 | return true; |
86 | default: |
87 | break; |
88 | } |
89 | return false; |
90 | } |
91 | |
92 | /** |
93 | * @param string $name |
94 | * @param mixed $value |
95 | */ |
96 | public function __set( string $name, $value ): void { |
97 | '@phan-var \Wikimedia\IDLeDOM\CSSNamespaceRule $this'; |
98 | // @var \Wikimedia\IDLeDOM\CSSNamespaceRule $this |
99 | switch ( $name ) { |
100 | case "cssText": |
101 | $this->setCssText( $value ); |
102 | return; |
103 | default: |
104 | break; |
105 | } |
106 | '@phan-var \Wikimedia\IDLeDOM\Helper\CSSNamespaceRule $this'; |
107 | // @var \Wikimedia\IDLeDOM\Helper\CSSNamespaceRule $this |
108 | $this->_setMissingProp( $name, $value ); |
109 | } |
110 | |
111 | /** |
112 | * @param string $name |
113 | */ |
114 | public function __unset( string $name ): void { |
115 | '@phan-var \Wikimedia\IDLeDOM\CSSNamespaceRule $this'; |
116 | // @var \Wikimedia\IDLeDOM\CSSNamespaceRule $this |
117 | switch ( $name ) { |
118 | case "cssText": |
119 | break; |
120 | case "parentRule": |
121 | break; |
122 | case "parentStyleSheet": |
123 | break; |
124 | case "type": |
125 | break; |
126 | case "namespaceURI": |
127 | break; |
128 | case "prefix": |
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 | } |