@@ 240-248 (lines=9) @@ | ||
237 | } |
|
238 | } |
|
239 | ||
240 | if (null === $value) { |
|
241 | if ($option->isValueRequired()) { |
|
242 | throw new \RuntimeException(sprintf('The "--%s" option requires a value.', $name)); |
|
243 | } |
|
244 | ||
245 | if (!$option->isArray()) { |
|
246 | $value = $option->isValueOptional() ? $option->getDefault() : true; |
|
247 | } |
|
248 | } |
|
249 | ||
250 | if ($option->isArray()) { |
|
251 | $this->options[$name][] = $value; |
@@ 184-190 (lines=7) @@ | ||
181 | ||
182 | $option = $this->definition->getOption($name); |
|
183 | ||
184 | if (null === $value) { |
|
185 | if ($option->isValueRequired()) { |
|
186 | throw new \InvalidArgumentException(sprintf('The "--%s" option requires a value.', $name)); |
|
187 | } |
|
188 | ||
189 | $value = $option->isValueOptional() ? $option->getDefault() : true; |
|
190 | } |
|
191 | ||
192 | $this->options[$name] = $value; |
|
193 | } |