Passed
Push — main ( e914fc...fdc5ba )
by Sammy
05:39
created
LeMarchand.php 1 patch
Spacing   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -16,7 +16,7 @@  discard block
 block discarded – undo
16 16
   public function __debugInfo() : array
17 17
   {
18 18
     $dbg = get_object_vars($this);
19
-    $dbg['configurations']['template_engine'] = isset($dbg['configurations']['template_engine'])? get_class($dbg['configurations']['template_engine']) : 'NOT SET';
19
+    $dbg['configurations']['template_engine'] = isset($dbg['configurations']['template_engine']) ? get_class($dbg['configurations']['template_engine']) : 'NOT SET';
20 20
 
21 21
     return $dbg;
22 22
   }
@@ -37,18 +37,18 @@  discard block
 block discarded – undo
37 37
 
38 38
     $construction_args = [];
39 39
     $instance = null;
40
-    if(!is_null($rc->getConstructor()))
40
+    if (!is_null($rc->getConstructor()))
41 41
     {
42
-      foreach($rc->getConstructor()->getParameters() as $param)
42
+      foreach ($rc->getConstructor()->getParameters() as $param)
43 43
       {
44
-        $construction_args []= $this->get($param->getType().'');
44
+        $construction_args [] = $this->get($param->getType().'');
45 45
       }
46 46
       $instance = $rc->newInstanceArgs($construction_args);
47 47
     }
48 48
     else
49 49
       $instance = $rc->newInstanceArgs();
50 50
 
51
-    if($rc->hasMethod('set_container'))
51
+    if ($rc->hasMethod('set_container'))
52 52
       $instance->set_container($this);
53 53
 
54 54
     return $instance;
@@ -60,9 +60,9 @@  discard block
 block discarded – undo
60 60
     $ret = $this->configurations;
61 61
 
62 62
     //dot based hierarchy, parse and climb
63
-    foreach(explode('.', $setting) as $k)
63
+    foreach (explode('.', $setting) as $k)
64 64
     {
65
-      if(!isset($ret[$k]))
65
+      if (!isset($ret[$k]))
66 66
         throw new ConfigurationException($setting);
67 67
       $ret = $ret[$k];
68 68
     }
@@ -73,21 +73,21 @@  discard block
 block discarded – undo
73 73
   public function get($configuration)
74 74
   {
75 75
 
76
-    if(!is_string($configuration))
76
+    if (!is_string($configuration))
77 77
       throw new LamentException($configuration);
78 78
 
79
-    if($this->has($configuration))
79
+    if ($this->has($configuration))
80 80
       return $this->configurations[$configuration];
81 81
 
82 82
     // fallbacks
83 83
     // 1. configuration data
84 84
     // 2. creating instances
85 85
     
86
-    if(preg_match('/^settings\./', $configuration, $m) === 1)
86
+    if (preg_match('/^settings\./', $configuration, $m) === 1)
87 87
     {
88 88
       return $this->get_settings($configuration);
89 89
     }
90
-    elseif(class_exists($configuration)) // auto create instances
90
+    elseif (class_exists($configuration)) // auto create instances
91 91
     {
92 92
       return $this->get_instance($configuration);
93 93
     }
Please login to merge, or discard this patch.