Code Duplication    Length = 5-6 lines in 2 locations

src/Command.php 2 locations

@@ 314-318 (lines=5) @@
311
                $this->parseArguments($args);
312
            } else {
313
                $this->args = (object) $args;
314
                foreach ($options as $name) {
315
                    if (!array_key_exists($name, $this->options))
316
                        throw new \Exception("Unknown option '{$name}'");
317
                    $this->options[$name] = true;
318
                }
319
            }
320
321
            if (null === $this->action)
@@ 346-351 (lines=6) @@
343
        }
344
345
        $arguments = [];
346
        foreach ($args as &$arg) {
347
            if (array_key_exists($arg, $this->options))
348
                $this->options[$arg] = true;
349
            else
350
                $arguments[] = $arg;
351
        }
352
        $arguments = T::join($arguments, ' ');
353
        $this->args = $this->syntax->parse($arguments);
354
    }