| @@ 345-349 (lines=5) @@ | ||
| 342 | $this->parseArguments($args); |
|
| 343 | } else { |
|
| 344 | $this->args = (object) $args; |
|
| 345 | foreach ($options as $name) { |
|
| 346 | if (!array_key_exists($name, $this->options)) |
|
| 347 | throw new \Exception("Unknown option '{$name}'"); |
|
| 348 | $this->options[$name] = true; |
|
| 349 | } |
|
| 350 | } |
|
| 351 | ||
| 352 | return $this->fire(); |
|
| @@ 381-386 (lines=6) @@ | ||
| 378 | } |
|
| 379 | ||
| 380 | $arguments = []; |
|
| 381 | foreach ($args as &$arg) { |
|
| 382 | if (array_key_exists($arg, $this->options)) |
|
| 383 | $this->options[$arg] = true; |
|
| 384 | else |
|
| 385 | $arguments[] = $arg; |
|
| 386 | } |
|
| 387 | $arguments = T::join($arguments, ' '); |
|
| 388 | $this->args = $this->syntax->parse($arguments); |
|
| 389 | } |
|