@@ -39,7 +39,7 @@ discard block |
||
| 39 | 39 | private function __construct($settings) |
| 40 | 40 | { |
| 41 | 41 | $this->configurations['settings'] = $settings; |
| 42 | - if(isset($settings['LeMarchand'])) |
|
| 42 | + if (isset($settings['LeMarchand'])) |
|
| 43 | 43 | { |
| 44 | 44 | $this->namespace_cascade = $settings['LeMarchand']['cascade'] ?? []; |
| 45 | 45 | $this->interface_wiring = $settings['LeMarchand']['wiring'] ?? []; |
@@ -144,12 +144,12 @@ discard block |
||
| 144 | 144 | } |
| 145 | 145 | |
| 146 | 146 | if ($mvc_type === 'Controller') { |
| 147 | - $class_name = $class_name . 'Controller'; |
|
| 147 | + $class_name = $class_name.'Controller'; |
|
| 148 | 148 | } |
| 149 | 149 | |
| 150 | 150 | // not fully namespaced, lets cascade |
| 151 | 151 | foreach ($this->namespace_cascade as $ns) { |
| 152 | - if (class_exists($full_name = $ns . $mvc_type . 's\\' . $class_name)) { |
|
| 152 | + if (class_exists($full_name = $ns.$mvc_type.'s\\'.$class_name)) { |
|
| 153 | 153 | return $full_name; |
| 154 | 154 | } |
| 155 | 155 | } |
@@ -163,7 +163,7 @@ discard block |
||
| 163 | 163 | throw new ConfigurationException($interface); |
| 164 | 164 | } |
| 165 | 165 | $wire = $this->interface_wiring[$interface]; |
| 166 | - if(is_array($wire)){ |
|
| 166 | + if (is_array($wire)) { |
|
| 167 | 167 | $class = array_shift($wire); |
| 168 | 168 | return $this->getInstance($class, $wire); |
| 169 | 169 | } |
@@ -177,16 +177,16 @@ discard block |
||
| 177 | 177 | $instance = null; |
| 178 | 178 | |
| 179 | 179 | if (!is_null($rc->getConstructor())) { |
| 180 | - if(empty($construction_args)){ |
|
| 180 | + if (empty($construction_args)) { |
|
| 181 | 181 | foreach ($rc->getConstructor()->getParameters() as $param) { |
| 182 | - try{ |
|
| 183 | - if($param->getType()) |
|
| 182 | + try { |
|
| 183 | + if ($param->getType()) |
|
| 184 | 184 | $construction_args [] = $this->get($param->getType()->getName()); |
| 185 | - else{ |
|
| 185 | + else { |
|
| 186 | 186 | $setting = 'settings.Constructor.'.$class.'.'.$param->getName(); |
| 187 | - $construction_args []= $this->getSettings($setting); |
|
| 187 | + $construction_args [] = $this->getSettings($setting); |
|
| 188 | 188 | } |
| 189 | - }catch(NotFoundExceptionInterface $e){ |
|
| 189 | + } catch (NotFoundExceptionInterface $e) { |
|
| 190 | 190 | dd($e); |
| 191 | 191 | } |
| 192 | 192 | } |
@@ -180,13 +180,13 @@ |
||
| 180 | 180 | if(empty($construction_args)){ |
| 181 | 181 | foreach ($rc->getConstructor()->getParameters() as $param) { |
| 182 | 182 | try{ |
| 183 | - if($param->getType()) |
|
| 184 | - $construction_args [] = $this->get($param->getType()->getName()); |
|
| 185 | - else{ |
|
| 183 | + if($param->getType()) { |
|
| 184 | + $construction_args [] = $this->get($param->getType()->getName()); |
|
| 185 | + } else{ |
|
| 186 | 186 | $setting = 'settings.Constructor.'.$class.'.'.$param->getName(); |
| 187 | 187 | $construction_args []= $this->getSettings($setting); |
| 188 | 188 | } |
| 189 | - }catch(NotFoundExceptionInterface $e){ |
|
| 189 | + } catch(NotFoundExceptionInterface $e){ |
|
| 190 | 190 | dd($e); |
| 191 | 191 | } |
| 192 | 192 | } |