Passed
Push — main ( 8369ee...f9bc30 )
by Sammy
06:30
created
LeMarchand.php 2 patches
Spacing   +13 added lines, -13 removed lines patch added patch discarded remove patch
@@ -65,7 +65,7 @@  discard block
 block discarded – undo
65 65
 
66 66
         foreach ($dbg['interface_wiring'] as $interface => $wire) {
67 67
             if (is_array($wire)) {
68
-                $wire = array_shift($wire) . ' --array #' . count($wire);
68
+                $wire = array_shift($wire).' --array #'.count($wire);
69 69
             }
70 70
             $dbg['interface_wiring'][$interface] = $wire;
71 71
         }
@@ -110,44 +110,44 @@  discard block
 block discarded – undo
110 110
             // 5. is it cascadable ?
111 111
             preg_match(self::RX_MVC, $configuration, $m);
112 112
 
113
-            $class_name = $this->cascadeNamespace($m[1] . '\\' . $m[2]);
113
+            $class_name = $this->cascadeNamespace($m[1].'\\'.$m[2]);
114 114
 
115
-            if($this->hasClassNameModifier($configuration)){
115
+            if ($this->hasClassNameModifier($configuration)) {
116 116
               $ret = $class_name;
117 117
             }
118
-            elseif($this->hasNewInstanceModifier($configuration)){
118
+            elseif ($this->hasNewInstanceModifier($configuration)) {
119 119
               $ret = $this->makeInstance($class_name);
120 120
             }
121 121
             $ret = $this->getInstance($class_name);
122 122
         }
123 123
 
124
-        if(is_null($ret))
124
+        if (is_null($ret))
125 125
           throw new NotFoundException($configuration);
126 126
 
127 127
         return $ret;
128 128
     }
129 129
 
130
-    private function isFirstLevelKey($configuration){
130
+    private function isFirstLevelKey($configuration) {
131 131
       return isset($this->configurations[$configuration]);
132 132
     }
133 133
 
134
-    private function isSettings($configuration){
134
+    private function isSettings($configuration) {
135 135
       return preg_match(self::RX_SETTINGS, $configuration) === 1;
136 136
     }
137 137
 
138
-    private function isInterface($configuration){
138
+    private function isInterface($configuration) {
139 139
       return preg_match(self::RX_INTERFACE, $configuration) === 1;
140 140
     }
141 141
 
142
-    private function isModelOrController($configuration){
142
+    private function isModelOrController($configuration) {
143 143
       return preg_match(self::RX_MVC, $configuration) === 1;
144 144
     }
145 145
 
146
-    private function hasClassNameModifier($configuration){
146
+    private function hasClassNameModifier($configuration) {
147 147
       return strpos($configuration, '::class') !== false;
148 148
     }
149 149
 
150
-    private function hasNewInstanceModifier($configuration){
150
+    private function hasNewInstanceModifier($configuration) {
151 151
       return strpos($configuration, '::new') !== false;
152 152
     }
153 153
 
@@ -189,7 +189,7 @@  discard block
 block discarded – undo
189 189
 
190 190
         // not fully namespaced, lets cascade
191 191
         foreach ($this->namespace_cascade as $ns) {
192
-            if (class_exists($fully_namespaced = $ns . $class_name)) {
192
+            if (class_exists($fully_namespaced = $ns.$class_name)) {
193 193
                 $this->resolved($class_name, $fully_namespaced);
194 194
                 return $fully_namespaced;
195 195
             }
@@ -283,7 +283,7 @@  discard block
 block discarded – undo
283 283
                 if ($param->getType()) {
284 284
                     $construction_args [] = $this->get($param->getType()->getName());
285 285
                 } else {
286
-                    $setting = 'settings.Constructor.' . $constructor->class . '.' . $param->getName();
286
+                    $setting = 'settings.Constructor.'.$constructor->class.'.'.$param->getName();
287 287
                     $construction_args [] = $this->getSettings($setting);
288 288
                 }
289 289
                 // } catch (NotFoundExceptionInterface $e) {
Please login to merge, or discard this patch.
Braces   +8 added lines, -12 removed lines patch added patch discarded remove patch
@@ -96,17 +96,13 @@  discard block
 block discarded – undo
96 96
 
97 97
         if ($this->isFirstLevelKey($configuration)) {
98 98
             $ret = $this->configurations[$configuration];
99
-        }
100
-        elseif ($this->isSettings($configuration)) {
99
+        } elseif ($this->isSettings($configuration)) {
101 100
             $ret = $this->getSettings($configuration);
102
-        }
103
-        elseif (class_exists($configuration)) {
101
+        } elseif (class_exists($configuration)) {
104 102
             $ret = $this->getInstance($configuration);
105
-        }
106
-        elseif ($this->isInterface($configuration)) {
103
+        } elseif ($this->isInterface($configuration)) {
107 104
             $ret = $this->wireInstance($configuration);
108
-        }
109
-        elseif ($this->hasModelOrController($configuration)) {
105
+        } elseif ($this->hasModelOrController($configuration)) {
110 106
             // 5. is it cascadable ?
111 107
             preg_match(self::RX_MVC, $configuration, $m);
112 108
 
@@ -114,15 +110,15 @@  discard block
 block discarded – undo
114 110
 
115 111
             if($this->hasClassNameModifier($configuration)){
116 112
               $ret = $class_name;
117
-            }
118
-            elseif($this->hasNewInstanceModifier($configuration)){
113
+            } elseif($this->hasNewInstanceModifier($configuration)){
119 114
               $ret = $this->makeInstance($class_name);
120 115
             }
121 116
             $ret = $this->getInstance($class_name);
122 117
         }
123 118
 
124
-        if(is_null($ret))
125
-          throw new NotFoundException($configuration);
119
+        if(is_null($ret)) {
120
+                  throw new NotFoundException($configuration);
121
+        }
126 122
 
127 123
         return $ret;
128 124
     }
Please login to merge, or discard this patch.