1 | <?php |
||
34 | class MaterialComponent extends ComponentAbstract implements MaterialCMPTIF |
||
35 | { |
||
36 | private $shaderObj; |
||
37 | |||
38 | /** |
||
39 | * Initialize Component |
||
40 | * |
||
41 | * {@inheritdoc} |
||
42 | * |
||
43 | * @return bool |
||
44 | */ |
||
45 | 26 | public function initializeComponent(): bool |
|
50 | |||
51 | /** |
||
52 | * Return DOM attribute contents |
||
53 | * |
||
54 | * @return string |
||
55 | */ |
||
56 | 8 | public function getDomAttributeString(): string |
|
61 | |||
62 | /** |
||
63 | * Call passes all calls to no existing methods to self::methodProvider |
||
64 | * |
||
65 | * @param string $method |
||
66 | * @param array $args |
||
67 | * @throws InvalidComponentMethodException |
||
68 | */ |
||
69 | 12 | public function __call(string $method, $args) |
|
88 | |||
89 | /** |
||
90 | * Material Shader |
||
91 | * |
||
92 | * {@inheritdoc} |
||
93 | * |
||
94 | * @param null|string $shader |
||
95 | * @throws BadShaderCallException |
||
96 | * @return ShaderInterface|MaterialComponent |
||
97 | */ |
||
98 | 23 | public function shader(string $shader = null) |
|
113 | |||
114 | /** |
||
115 | * repeat |
||
116 | * |
||
117 | * @param float $x |
||
118 | * @param float $y |
||
119 | */ |
||
120 | 4 | public function repeat(float $x, float $y) |
|
125 | |||
126 | /** |
||
127 | * opacity |
||
128 | * |
||
129 | * {@inheritdoc} |
||
130 | * |
||
131 | * @param float $opacity |
||
132 | * @return MaterialCMPTIF |
||
133 | */ |
||
134 | 11 | public function opacity(float $opacity = 1.0): MaterialCMPTIF |
|
139 | |||
140 | /** |
||
141 | * transparent |
||
142 | * |
||
143 | * {@inheritdoc} |
||
144 | * |
||
145 | * @param bool $transparent |
||
146 | * @return MaterialCMPTIF |
||
147 | */ |
||
148 | 10 | public function transparent(bool $transparent = false): MaterialCMPTIF |
|
153 | |||
154 | /** |
||
155 | * depthTest |
||
156 | * |
||
157 | * {@inheritdoc} |
||
158 | * |
||
159 | * @param bool $depth_test |
||
160 | * @return MaterialCMPTIF |
||
161 | */ |
||
162 | 1 | public function depthTest(bool $depth_test = true): MaterialCMPTIF |
|
167 | |||
168 | /** |
||
169 | * side |
||
170 | * |
||
171 | * {@inheritdoc} |
||
172 | * |
||
173 | * @param string $side |
||
174 | * @return MaterialCMPTIF |
||
175 | */ |
||
176 | 9 | public function side(string $side = 'front'): MaterialCMPTIF |
|
181 | |||
182 | /** |
||
183 | * Do not apply fog to certain entities, we can disable fog for certain materials. |
||
184 | * |
||
185 | * @param bool $fog |
||
186 | * @return MaterialCMPTIF |
||
187 | */ |
||
188 | 1 | public function fog(bool $fog = true): MaterialCMPTIF |
|
193 | |||
194 | /** |
||
195 | * roughness |
||
196 | * |
||
197 | * @param bool $roughness |
||
|
|||
198 | * @return MaterialCMPTIF |
||
199 | */ |
||
200 | 4 | public function roughness(float $roughness): MaterialCMPTIF |
|
205 | |||
206 | /** |
||
207 | * Prepare Shader attributes |
||
208 | * |
||
209 | * @return void |
||
210 | */ |
||
211 | 8 | private function prepareShader() |
|
217 | } |
||
218 |
This check looks for
@param
annotations where the type inferred by our type inference engine differs from the declared type.It makes a suggestion as to what type it considers more descriptive.
Most often this is a case of a parameter that can be null in addition to its declared types.