@@ -165,7 +165,7 @@ discard block |
||
| 165 | 165 | } else if ($argumentValue === null) { |
| 166 | 166 | throw new exceptions\InjectionException("Could not resolve a value for {$argumentName} of type {$className} for {$method->getDeclaringClass()->getName()}{$method->getName()}"); |
| 167 | 167 | } |
| 168 | - $argumentValues[]=$argumentValue; |
|
| 168 | + $argumentValues[] = $argumentValue; |
|
| 169 | 169 | } else { |
| 170 | 170 | throw new exceptions\InjectionException("Could not resolve a value for {$argumentName} of type {$type} for {$method->getDeclaringClass()->getName()}{$method->getName()}"); |
| 171 | 171 | } |
@@ -192,8 +192,8 @@ discard block |
||
| 192 | 192 | private function injectAttributed(mixed $instance, \ReflectionClass $reflection): void |
| 193 | 193 | { |
| 194 | 194 | // Properties |
| 195 | - foreach($reflection->getProperties() as $property) { |
|
| 196 | - if (count($property->getAttributes(Inject::class)) == 0 ) { |
|
| 195 | + foreach ($reflection->getProperties() as $property) { |
|
| 196 | + if (count($property->getAttributes(Inject::class)) == 0) { |
|
| 197 | 197 | continue; |
| 198 | 198 | } |
| 199 | 199 | $type = $property->getType(); |
@@ -203,7 +203,7 @@ discard block |
||
| 203 | 203 | $propertyValue = $this->bindings->has("$$name:$typeName") |
| 204 | 204 | ? $this->resolve($typeName, $name) |
| 205 | 205 | : $this->resolve($typeName); |
| 206 | - if($propertyValue === null) { |
|
| 206 | + if ($propertyValue === null) { |
|
| 207 | 207 | throw new exceptions\InjectionException("Failed to resolve a value for property."); |
| 208 | 208 | } |
| 209 | 209 | $property->setValue($instance, $propertyValue); |
@@ -213,7 +213,7 @@ discard block |
||
| 213 | 213 | } |
| 214 | 214 | |
| 215 | 215 | // Methods |
| 216 | - foreach($reflection->getMethods() as $method) { |
|
| 216 | + foreach ($reflection->getMethods() as $method) { |
|
| 217 | 217 | if (count($method->getAttributes(Inject::class)) == 0) { |
| 218 | 218 | continue; |
| 219 | 219 | } |
@@ -229,7 +229,7 @@ discard block |
||
| 229 | 229 | * @return mixed |
| 230 | 230 | * @throws exceptions\ResolutionException |
| 231 | 231 | */ |
| 232 | - private function getInstance(string|callable $class): mixed |
|
| 232 | + private function getInstance(string | callable $class): mixed |
|
| 233 | 233 | { |
| 234 | 234 | // If the class is a function call it as a factory. |
| 235 | 235 | if (is_callable($class)) { |