@@ -40,7 +40,7 @@ discard block |
||
40 | 40 | return $this->getSingletonInstance($type, $resolvedClass, $constructorArguments); |
41 | 41 | } |
42 | 42 | |
43 | - private function getSingletonInstance($type, $class, $constructorArguments) { |
|
43 | + private function getSingletonInstance($type, $class, $constructorArguments) { |
|
44 | 44 | if (!isset($this->singletons[$type])) { |
45 | 45 | $this->singletons[$type] = $this->getInstance($class, $constructorArguments); |
46 | 46 | } |
@@ -48,14 +48,14 @@ discard block |
||
48 | 48 | } |
49 | 49 | |
50 | 50 | public function resolve($type, $constructorArguments = []) { |
51 | - if($type === null) { |
|
51 | + if ($type === null) { |
|
52 | 52 | throw new exceptions\ResolutionException("Cannot resolve an empty type"); |
53 | 53 | } |
54 | 54 | $resolvedClass = $this->getResolvedClassName($type); |
55 | 55 | if ($resolvedClass['class'] === null) { |
56 | 56 | throw new exceptions\ResolutionException("Could not resolve dependency $type"); |
57 | 57 | } |
58 | - if(isset($resolvedClass['singleton'])) { |
|
58 | + if (isset($resolvedClass['singleton'])) { |
|
59 | 59 | return $this->getSingletonInstance($type, $resolvedClass['class'], $constructorArguments); |
60 | 60 | } else { |
61 | 61 | return $this->getInstance($resolvedClass['class'], $constructorArguments); |
@@ -80,7 +80,7 @@ discard block |
||
80 | 80 | $class = $parameter->getClass(); |
81 | 81 | if (isset($constructorArguments[$parameter->getName()])) { |
82 | 82 | $instanceParameters[] = $constructorArguments[$parameter->getName()]; |
83 | - } else if($class == self::class){ |
|
83 | + } else if ($class == self::class) { |
|
84 | 84 | $instanceParameters[] = $this; |
85 | 85 | } else { |
86 | 86 | $instanceParameters[] = $class ? $this->resolve($class->getName()) : null; |