@@ -214,7 +214,7 @@ discard block |
||
214 | 214 | */ |
215 | 215 | public function set(string $sClass, Closure $xClosure) |
216 | 216 | { |
217 | - $this->xLibContainer->offsetSet($sClass, function() use($xClosure) { |
|
217 | + $this->xLibContainer->offsetSet($sClass, function() use($xClosure) { |
|
218 | 218 | return $xClosure($this); |
219 | 219 | }); |
220 | 220 | } |
@@ -229,7 +229,7 @@ discard block |
||
229 | 229 | */ |
230 | 230 | public function val(string $sKey, $xValue) |
231 | 231 | { |
232 | - $this->xLibContainer->offsetSet($sKey, $xValue); |
|
232 | + $this->xLibContainer->offsetSet($sKey, $xValue); |
|
233 | 233 | } |
234 | 234 | |
235 | 235 | /** |
@@ -157,7 +157,7 @@ discard block |
||
157 | 157 | */ |
158 | 158 | public function has(string $sClass): bool |
159 | 159 | { |
160 | - if($this->xAppContainer != null && $this->xAppContainer->has($sClass)) |
|
160 | + if ($this->xAppContainer != null && $this->xAppContainer->has($sClass)) |
|
161 | 161 | { |
162 | 162 | return true; |
163 | 163 | } |
@@ -188,13 +188,13 @@ discard block |
||
188 | 188 | { |
189 | 189 | try |
190 | 190 | { |
191 | - if($this->xAppContainer != null && $this->xAppContainer->has($sClass)) |
|
191 | + if ($this->xAppContainer != null && $this->xAppContainer->has($sClass)) |
|
192 | 192 | { |
193 | 193 | return $this->xAppContainer->get($sClass); |
194 | 194 | } |
195 | 195 | return $this->xLibContainer->offsetGet($sClass); |
196 | 196 | } |
197 | - catch(Exception|Throwable $e) |
|
197 | + catch (Exception | Throwable $e) |
|
198 | 198 | { |
199 | 199 | $xLogger = $this->g(LoggerInterface::class); |
200 | 200 | $xTranslator = $this->g(Translator::class); |
@@ -258,15 +258,15 @@ discard block |
||
258 | 258 | { |
259 | 259 | $xType = $xParameter->getType(); |
260 | 260 | // Check the parameter class first. |
261 | - if($xType instanceof ReflectionNamedType) |
|
261 | + if ($xType instanceof ReflectionNamedType) |
|
262 | 262 | { |
263 | 263 | // Check the class + the name |
264 | - if($this->has($xType->getName() . ' $' . $xParameter->getName())) |
|
264 | + if ($this->has($xType->getName() . ' $' . $xParameter->getName())) |
|
265 | 265 | { |
266 | 266 | return $this->get($xType->getName() . ' $' . $xParameter->getName()); |
267 | 267 | } |
268 | 268 | // Check the class only |
269 | - if($this->get($xType->getName())) |
|
269 | + if ($this->get($xType->getName())) |
|
270 | 270 | { |
271 | 271 | return $this->get($xType->getName()); |
272 | 272 | } |
@@ -286,16 +286,16 @@ discard block |
||
286 | 286 | */ |
287 | 287 | public function make($xClass) |
288 | 288 | { |
289 | - if(is_string($xClass)) |
|
289 | + if (is_string($xClass)) |
|
290 | 290 | { |
291 | 291 | $xClass = new ReflectionClass($xClass); // Create the reflection class instance |
292 | 292 | } |
293 | - if(!($xClass instanceof ReflectionClass)) |
|
293 | + if (!($xClass instanceof ReflectionClass)) |
|
294 | 294 | { |
295 | 295 | return null; |
296 | 296 | } |
297 | 297 | // Use the Reflection class to get the parameters of the constructor |
298 | - if(($constructor = $xClass->getConstructor()) === null) |
|
298 | + if (($constructor = $xClass->getConstructor()) === null) |
|
299 | 299 | { |
300 | 300 | return $xClass->newInstance(); |
301 | 301 | } |
@@ -193,8 +193,7 @@ |
||
193 | 193 | return $this->xAppContainer->get($sClass); |
194 | 194 | } |
195 | 195 | return $this->xLibContainer->offsetGet($sClass); |
196 | - } |
|
197 | - catch(Exception|Throwable $e) |
|
196 | + } catch(Exception|Throwable $e) |
|
198 | 197 | { |
199 | 198 | $xLogger = $this->g(LoggerInterface::class); |
200 | 199 | $xTranslator = $this->g(Translator::class); |
@@ -134,23 +134,23 @@ discard block |
||
134 | 134 | */ |
135 | 135 | public static function make($xValue): ParameterInterface |
136 | 136 | { |
137 | - if($xValue instanceof ParameterInterface) |
|
137 | + if ($xValue instanceof ParameterInterface) |
|
138 | 138 | { |
139 | 139 | return $xValue; |
140 | 140 | } |
141 | - if(is_numeric($xValue)) |
|
141 | + if (is_numeric($xValue)) |
|
142 | 142 | { |
143 | 143 | return new Parameter(self::NUMERIC_VALUE, $xValue); |
144 | 144 | } |
145 | - if(is_string($xValue)) |
|
145 | + if (is_string($xValue)) |
|
146 | 146 | { |
147 | 147 | return new Parameter(self::QUOTED_VALUE, $xValue); |
148 | 148 | } |
149 | - if(is_bool($xValue)) |
|
149 | + if (is_bool($xValue)) |
|
150 | 150 | { |
151 | 151 | return new Parameter(self::BOOL_VALUE, $xValue); |
152 | 152 | } |
153 | - if($xValue instanceof JsCall) |
|
153 | + if ($xValue instanceof JsCall) |
|
154 | 154 | { |
155 | 155 | return new Parameter(self::JS_CALL, $xValue); |
156 | 156 | } |
@@ -252,7 +252,7 @@ discard block |
||
252 | 252 | */ |
253 | 253 | protected function getNumericValueScript(): string |
254 | 254 | { |
255 | - return (string)$this->xValue; |
|
255 | + return (string) $this->xValue; |
|
256 | 256 | } |
257 | 257 | |
258 | 258 | /** |
@@ -262,7 +262,7 @@ discard block |
||
262 | 262 | */ |
263 | 263 | protected function getUnquotedValueScript(): string |
264 | 264 | { |
265 | - return (string)$this->xValue; |
|
265 | + return (string) $this->xValue; |
|
266 | 266 | } |
267 | 267 | |
268 | 268 | /** |
@@ -284,7 +284,7 @@ discard block |
||
284 | 284 | */ |
285 | 285 | protected function getPageNumberScript(): string |
286 | 286 | { |
287 | - return (string)$this->xValue; |
|
287 | + return (string) $this->xValue; |
|
288 | 288 | } |
289 | 289 | |
290 | 290 | /** |
@@ -305,7 +305,7 @@ discard block |
||
305 | 305 | public function getScript(): string |
306 | 306 | { |
307 | 307 | $sMethodName = 'get' . $this->sType . 'Script'; |
308 | - if(!method_exists($this, $sMethodName)) |
|
308 | + if (!method_exists($this, $sMethodName)) |
|
309 | 309 | { |
310 | 310 | return ''; |
311 | 311 | } |