@@ -38,7 +38,7 @@ discard block |
||
| 38 | 38 | |
| 39 | 39 | public function to($value) |
| 40 | 40 | { |
| 41 | - if(isset($this->bindings[$this->activeKey])) { |
|
| 41 | + if (isset($this->bindings[$this->activeKey])) { |
|
| 42 | 42 | $this->bindings[$this->activeKey]['binding'] = $value; |
| 43 | 43 | } else { |
| 44 | 44 | $this->bindings[$this->activeKey] = ['binding' => $value, 'calls' => [], 'properties' => []]; |
@@ -63,13 +63,13 @@ discard block |
||
| 63 | 63 | |
| 64 | 64 | private function setArrayBinding($binding) |
| 65 | 65 | { |
| 66 | - if(isset($binding[0])) { |
|
| 66 | + if (isset($binding[0])) { |
|
| 67 | 67 | $this->to($binding[0]); |
| 68 | 68 | } |
| 69 | 69 | |
| 70 | - if(isset($binding['calls'])){ |
|
| 71 | - foreach($binding['calls'] as $call => $parameters) { |
|
| 72 | - if(is_numeric($call)) { |
|
| 70 | + if (isset($binding['calls'])) { |
|
| 71 | + foreach ($binding['calls'] as $call => $parameters) { |
|
| 72 | + if (is_numeric($call)) { |
|
| 73 | 73 | $call = $parameters; |
| 74 | 74 | $parameters = []; |
| 75 | 75 | } |
@@ -79,9 +79,9 @@ discard block |
||
| 79 | 79 | $this->bindings[$this->activeKey]['calls'] = []; |
| 80 | 80 | } |
| 81 | 81 | |
| 82 | - if(isset($binding['sets'])){ |
|
| 83 | - foreach($binding['sets'] as $property => $parameters) { |
|
| 84 | - if(is_numeric($property)) { |
|
| 82 | + if (isset($binding['sets'])) { |
|
| 83 | + foreach ($binding['sets'] as $property => $parameters) { |
|
| 84 | + if (is_numeric($property)) { |
|
| 85 | 85 | $property = $parameters; |
| 86 | 86 | $parameters = []; |
| 87 | 87 | } |
@@ -96,9 +96,9 @@ discard block |
||
| 96 | 96 | |
| 97 | 97 | public function merge($bindings) |
| 98 | 98 | { |
| 99 | - foreach($bindings as $key => $binding) { |
|
| 99 | + foreach ($bindings as $key => $binding) { |
|
| 100 | 100 | $this->activeKey = $key; |
| 101 | - if(is_array($binding)) { |
|
| 101 | + if (is_array($binding)) { |
|
| 102 | 102 | $this->setArrayBinding($binding); |
| 103 | 103 | } else { |
| 104 | 104 | $this->bindings[$key] = ['binding' => $binding, 'calls' => [], 'properties' => []]; |
@@ -64,7 +64,7 @@ discard block |
||
| 64 | 64 | $instance = $this->getInstance($resolvedClass['binding'], $constructorArguments); |
| 65 | 65 | } |
| 66 | 66 | |
| 67 | - foreach($resolvedClass['calls'] ?? [] as $method => $parameters) { |
|
| 67 | + foreach ($resolvedClass['calls'] ?? [] as $method => $parameters) { |
|
| 68 | 68 | $method = new \ReflectionMethod($instance, $method); |
| 69 | 69 | $method->invokeArgs($instance, $this->getMethodArguments($method, $parameters)); |
| 70 | 70 | } |
@@ -74,7 +74,7 @@ discard block |
||
| 74 | 74 | |
| 75 | 75 | private function resolveArgument($argument, $class) |
| 76 | 76 | { |
| 77 | - if($class && is_string($argument)) { |
|
| 77 | + if ($class && is_string($argument)) { |
|
| 78 | 78 | return $this->resolve($argument); |
| 79 | 79 | } |
| 80 | 80 | return $argument; |