Passed
Push — main ( b663cc...120722 )
by Thierry
02:08
created
src/Di/Traits/RegisterTrait.php 1 patch
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -33,7 +33,7 @@  discard block
 block discarded – undo
33 33
      */
34 34
     private function setDiAttributes($xRegisteredObject, array $aDiOptions)
35 35
     {
36
-        foreach($aDiOptions as $sName => $sClass)
36
+        foreach ($aDiOptions as $sName => $sClass)
37 37
         {
38 38
             // Set the protected attributes of the object
39 39
             $cSetter = function($xInjectedObject) use($sName) {
@@ -63,7 +63,7 @@  discard block
 block discarded – undo
63 63
         $this->setDiAttributes($xRegisteredObject, $aDiOptions);
64 64
 
65 65
         // Set the Jaxon request target in the helper
66
-        if($xRegisteredObject instanceof CallableClass)
66
+        if ($xRegisteredObject instanceof CallableClass)
67 67
         {
68 68
             // Set the protected attributes of the object
69 69
             $cSetter = function() use($xTarget) {
@@ -91,13 +91,13 @@  discard block
 block discarded – undo
91 91
         $sReflectionClass = $sClassName . '_ReflectionClass';
92 92
 
93 93
         // Prevent duplication
94
-        if($this->h($sReflectionClass)) // It's important not to use the class name here.
94
+        if ($this->h($sReflectionClass)) // It's important not to use the class name here.
95 95
         {
96 96
             return;
97 97
         }
98 98
 
99 99
         // Make sure the registered class exists
100
-        if(isset($aOptions['include']))
100
+        if (isset($aOptions['include']))
101 101
         {
102 102
             require_once($aOptions['include']);
103 103
         }
@@ -106,7 +106,7 @@  discard block
 block discarded – undo
106 106
         {
107 107
             $this->val($sReflectionClass, new ReflectionClass($sClassName));
108 108
         }
109
-        catch(ReflectionException $e)
109
+        catch (ReflectionException $e)
110 110
         {
111 111
             $xTranslator = $this->g(Translator::class);
112 112
             $sMessage = $xTranslator->trans('errors.class.invalid', ['name' => $sClassName]);
@@ -130,7 +130,7 @@  discard block
 block discarded – undo
130 130
         });
131 131
 
132 132
         // Register the user class, but only if the user didn't already.
133
-        if(!$this->h($sClassName))
133
+        if (!$this->h($sClassName))
134 134
         {
135 135
             $this->set($sClassName, function($di) use($sReflectionClass) {
136 136
                 return $this->make($di->g($sReflectionClass));
@@ -139,7 +139,7 @@  discard block
 block discarded – undo
139 139
         // Initialize the user class instance
140 140
         $this->xLibContainer->extend($sClassName, function($xRegisteredObject)
141 141
             use($sCallableObject, $sClassName) {
142
-            if($xRegisteredObject instanceof CallableClass)
142
+            if ($xRegisteredObject instanceof CallableClass)
143 143
             {
144 144
                 $cSetter = function($di) use($sClassName) {
145 145
                     // Set the protected attributes of the object
@@ -152,7 +152,7 @@  discard block
 block discarded – undo
152 152
 
153 153
             // Run the callbacks for class initialisation
154 154
             $aCallbacks = $this->g(CallbackManager::class)->getInitCallbacks();
155
-            foreach($aCallbacks as $xCallback)
155
+            foreach ($aCallbacks as $xCallback)
156 156
             {
157 157
                 call_user_func($xCallback, $xRegisteredObject);
158 158
             }
@@ -216,7 +216,7 @@  discard block
 block discarded – undo
216 216
         $sPkgConfigKey = $this->getPackageConfigKey($sClassName);
217 217
         $this->val($sPkgConfigKey, $xPkgConfig);
218 218
         // Register the user class, but only if the user didn't already.
219
-        if(!$this->h($sClassName))
219
+        if (!$this->h($sClassName))
220 220
         {
221 221
             $this->set($sClassName, function() use($sClassName) {
222 222
                 return $this->make($sClassName);
Please login to merge, or discard this patch.