@@ -98,7 +98,7 @@ discard block |
||
| 98 | 98 | if (isset($this->shared[$class]) && isset($this->sharedInstance[$class])) { |
| 99 | 99 | return $this->sharedInstance[$class]; |
| 100 | 100 | } |
| 101 | - if (! $this->has($class)) { |
|
| 101 | + if (!$this->has($class)) { |
|
| 102 | 102 | throw new NotFoundException('Class or alias ' . $class . ' does not exist'); |
| 103 | 103 | } |
| 104 | 104 | while ($preference = $this->preferences[$class] ?? false) { |
@@ -131,7 +131,7 @@ discard block |
||
| 131 | 131 | $methodInfo = $this->getMethodInfo(new \ReflectionMethod($class, $method)); |
| 132 | 132 | foreach ($instance as $methodParameters) { |
| 133 | 133 | $methodParams = $this->getParameters($methodInfo, $methodParameters); |
| 134 | - $callback = function ($params) use ($callback, $method, $methodParams) { |
|
| 134 | + $callback = function($params) use ($callback, $method, $methodParams) { |
|
| 135 | 135 | $object = $callback($params); |
| 136 | 136 | $object->$method(...$methodParams); |
| 137 | 137 | return $object; |
@@ -145,15 +145,15 @@ discard block |
||
| 145 | 145 | protected function generateCallback(string $class): callable |
| 146 | 146 | { |
| 147 | 147 | $constructor = (new \ReflectionClass($class))->getConstructor(); |
| 148 | - if (! $constructor || ! $constructor->getNumberOfParameters()) { |
|
| 149 | - return function () use ($class) { |
|
| 148 | + if (!$constructor || !$constructor->getNumberOfParameters()) { |
|
| 149 | + return function() use ($class) { |
|
| 150 | 150 | return new $class; |
| 151 | 151 | }; |
| 152 | 152 | } |
| 153 | 153 | $constructorInfo = $this->getMethodInfo($constructor); |
| 154 | 154 | $predefinedParams = $this->params[$class] ?? []; |
| 155 | 155 | |
| 156 | - return function ($params) use ($class, $constructorInfo, $predefinedParams) { |
|
| 156 | + return function($params) use ($class, $constructorInfo, $predefinedParams) { |
|
| 157 | 157 | return new $class(...$this->getParameters($constructorInfo, $params + $predefinedParams)); |
| 158 | 158 | }; |
| 159 | 159 | } |
@@ -1,7 +1,6 @@ |
||
| 1 | 1 | <?php |
| 2 | 2 | namespace DD; |
| 3 | 3 | |
| 4 | -use DD\DiMaria\Exception\DiMariaException; |
|
| 5 | 4 | use DD\DiMaria\Exception\NotFoundException; |
| 6 | 5 | use Interop\Container\ContainerInterface; |
| 7 | 6 | |