Completed
Push — master ( 31e600...4f49ce )
by James Ekow Abaka
01:53
created
src/Container.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -44,7 +44,7 @@  discard block
 block discarded – undo
44 44
         return $this->getSingletonInstance($type, $resolvedClass, $constructorArguments);
45 45
     }
46 46
     
47
-    private function getSingletonInstance($type, $class,  $constructorArguments) {
47
+    private function getSingletonInstance($type, $class, $constructorArguments) {
48 48
         if (!isset($this->singletons[$type])) {
49 49
             $this->singletons[$type] = $this->getInstance($class, $constructorArguments);
50 50
         }
@@ -52,14 +52,14 @@  discard block
 block discarded – undo
52 52
     }
53 53
     
54 54
     public function resolve($type, $constructorArguments = []) {
55
-        if($type === null) {
55
+        if ($type === null) {
56 56
             throw new exceptions\ResolutionException("Cannot resolve an empty type");
57 57
         } 
58 58
         $resolvedClass = $this->getResolvedClassName($type);
59 59
         if ($resolvedClass['binding'] === null) {
60 60
             throw new exceptions\ResolutionException("Could not resolve dependency $type");
61 61
         }           
62
-        if(isset($resolvedClass['singleton'])) {
62
+        if (isset($resolvedClass['singleton'])) {
63 63
             return $this->getSingletonInstance($type, $resolvedClass['binding'], $constructorArguments);
64 64
         } else {
65 65
             return $this->getInstance($resolvedClass['binding'], $constructorArguments);
@@ -70,7 +70,7 @@  discard block
 block discarded – undo
70 70
         if (is_callable($className)) {
71 71
             return $className($this);
72 72
         }
73
-        if(is_object($className)) {
73
+        if (is_object($className)) {
74 74
             return $className;
75 75
         } 
76 76
         $reflection = new \ReflectionClass($className);
@@ -90,7 +90,7 @@  discard block
 block discarded – undo
90 90
                 $className = $class ? $class->getName() : null;
91 91
                 if (isset($constructorArguments[$parameter->getName()])) {
92 92
                     $instanceParameters[] = $constructorArguments[$parameter->getName()];
93
-                } else if($className == self::class){
93
+                } else if ($className == self::class) {
94 94
                     $instanceParameters[] = $this;
95 95
                 } else {                    
96 96
                     $instanceParameters[] = $className ? $this->resolve($className) : null;
Please login to merge, or discard this patch.