Completed
Push — main ( 5c230d...fb1e93 )
by James Ekow Abaka
23:00
created
src/Container.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -163,7 +163,7 @@  discard block
 block discarded – undo
163 163
                 } else if ($argumentValue === null) {
164 164
                     throw new exceptions\InjectionException("Could not resolve a value for {$argumentName} of {$method->getDeclaringClass()->getName()}{$method->getName()}");
165 165
                 }
166
-                $argumentValues[]=$argumentValue;
166
+                $argumentValues[] = $argumentValue;
167 167
             } else {
168 168
                 throw new exceptions\InjectionException("Could not resolve a value for {$argumentName} of {$method->getDeclaringClass()->getName()}{$method->getName()}");
169 169
             }
@@ -190,8 +190,8 @@  discard block
 block discarded – undo
190 190
     private function injectAttributed(mixed $instance, \ReflectionClass $reflection): void
191 191
     {
192 192
         // Properties
193
-        foreach($reflection->getProperties() as $property) {
194
-            if (count($property->getAttributes(Inject::class)) == 0 ) {
193
+        foreach ($reflection->getProperties() as $property) {
194
+            if (count($property->getAttributes(Inject::class)) == 0) {
195 195
                 continue;
196 196
             }
197 197
             $type = $property->getType();
@@ -201,7 +201,7 @@  discard block
 block discarded – undo
201 201
                 $propertyValue = $this->bindings->has("$$name:$typeName") 
202 202
                         ? $this->resolve($typeName, $name) 
203 203
                         : $this->resolve($typeName);
204
-                if($propertyValue === null) {
204
+                if ($propertyValue === null) {
205 205
                     throw new exceptions\InjectionException("Failed to resolve a value for property.");
206 206
                 }
207 207
                 $property->setValue($instance, $propertyValue);
@@ -211,7 +211,7 @@  discard block
 block discarded – undo
211 211
         }
212 212
         
213 213
         // Methods
214
-        foreach($reflection->getMethods() as $method) {
214
+        foreach ($reflection->getMethods() as $method) {
215 215
             if (count($method->getAttributes(Inject::class)) == 0) {
216 216
                 continue;
217 217
             }
@@ -227,7 +227,7 @@  discard block
 block discarded – undo
227 227
      * @return mixed
228 228
      * @throws exceptions\ResolutionException
229 229
      */
230
-    private function getInstance(string|callable $class): mixed
230
+    private function getInstance(string | callable $class): mixed
231 231
     {
232 232
         // If the class is a function call it as a factory.
233 233
         if (is_callable($class)) {
Please login to merge, or discard this patch.