@@ -141,7 +141,7 @@ discard block |
||
| 141 | 141 | */ |
| 142 | 142 | public function has(string $sClass): bool |
| 143 | 143 | { |
| 144 | - if($this->xContainer != null && $this->xContainer->has($sClass)) |
|
| 144 | + if ($this->xContainer != null && $this->xContainer->has($sClass)) |
|
| 145 | 145 | { |
| 146 | 146 | return true; |
| 147 | 147 | } |
@@ -172,13 +172,13 @@ discard block |
||
| 172 | 172 | { |
| 173 | 173 | try |
| 174 | 174 | { |
| 175 | - if($this->xContainer != null && $this->xContainer->has($sClass)) |
|
| 175 | + if ($this->xContainer != null && $this->xContainer->has($sClass)) |
|
| 176 | 176 | { |
| 177 | 177 | return $this->xContainer->get($sClass); |
| 178 | 178 | } |
| 179 | 179 | return $this->offsetGet($sClass); |
| 180 | 180 | } |
| 181 | - catch(Exception|Throwable $e) |
|
| 181 | + catch (Exception | Throwable $e) |
|
| 182 | 182 | { |
| 183 | 183 | $xTranslator = $this->g(Translator::class); |
| 184 | 184 | $sMessage = $xTranslator->trans('errors.class.container', ['name' => $sClass]); |
@@ -238,22 +238,22 @@ discard block |
||
| 238 | 238 | */ |
| 239 | 239 | public function make($xClass) |
| 240 | 240 | { |
| 241 | - if(is_string($xClass)) |
|
| 241 | + if (is_string($xClass)) |
|
| 242 | 242 | { |
| 243 | 243 | $xClass = new ReflectionClass($xClass); // Create the reflection class instance |
| 244 | 244 | } |
| 245 | - if(!($xClass instanceof ReflectionClass)) |
|
| 245 | + if (!($xClass instanceof ReflectionClass)) |
|
| 246 | 246 | { |
| 247 | 247 | return null; |
| 248 | 248 | } |
| 249 | 249 | // Use the Reflection class to get the parameters of the constructor |
| 250 | - if(($constructor = $xClass->getConstructor()) === null) |
|
| 250 | + if (($constructor = $xClass->getConstructor()) === null) |
|
| 251 | 251 | { |
| 252 | 252 | return $xClass->newInstance(); |
| 253 | 253 | } |
| 254 | 254 | $parameters = $constructor->getParameters(); |
| 255 | 255 | $parameterInstances = []; |
| 256 | - foreach($parameters as $parameter) |
|
| 256 | + foreach ($parameters as $parameter) |
|
| 257 | 257 | { |
| 258 | 258 | // Get the parameter instance from the DI |
| 259 | 259 | $parameterInstances[] = $this->get($parameter->getType()); |