@@ -129,14 +129,14 @@ discard block |
||
| 129 | 129 | $class = new ReflectionClass($command); |
| 130 | 130 | foreach ($class->getConstructor()->getParameters() as $parameter) { |
| 131 | 131 | if ($parameter->getPosition() == 0 && $parameter->isArray()) { |
| 132 | - if ($input !== []){ |
|
| 132 | + if ($input !== []) { |
|
| 133 | 133 | $dependencies[] = $input; |
| 134 | 134 | } else { |
| 135 | 135 | $dependencies[] = $this->getDefaultValueOrFail($parameter); |
| 136 | 136 | } |
| 137 | 137 | } else { |
| 138 | 138 | $name = $parameter->getName(); |
| 139 | - if (array_key_exists($name, $input)){ |
|
| 139 | + if (array_key_exists($name, $input)) { |
|
| 140 | 140 | $dependencies[] = $input[$name]; |
| 141 | 141 | } else { |
| 142 | 142 | $dependencies[] = $this->getDefaultValueOrFail($parameter); |
@@ -153,7 +153,7 @@ discard block |
||
| 153 | 153 | * @ReflectionParameter $parameter |
| 154 | 154 | * @return mixed |
| 155 | 155 | */ |
| 156 | - private function getDefaultValueOrFail($parameter){ |
|
| 156 | + private function getDefaultValueOrFail($parameter) { |
|
| 157 | 157 | if (!$parameter->isDefaultValueAvailable()) |
| 158 | 158 | throw new InvalidArgumentException("Unable to map input to command: {$parameter->getName()}"); |
| 159 | 159 | |
@@ -154,8 +154,9 @@ |
||
| 154 | 154 | * @return mixed |
| 155 | 155 | */ |
| 156 | 156 | private function getDefaultValueOrFail($parameter){ |
| 157 | - if (!$parameter->isDefaultValueAvailable()) |
|
| 158 | - throw new InvalidArgumentException("Unable to map input to command: {$parameter->getName()}"); |
|
| 157 | + if (!$parameter->isDefaultValueAvailable()) { |
|
| 158 | + throw new InvalidArgumentException("Unable to map input to command: {$parameter->getName()}"); |
|
| 159 | + } |
|
| 159 | 160 | |
| 160 | 161 | return $parameter->getDefaultValue(); |
| 161 | 162 | } |