Ejemplo n.º 1
0
 /**
  * @param array $args
  *
  * @throws Exception
  */
 protected function handleArgs(array $args)
 {
     $groupedArgs = $this->argumentsParser->group($args);
     list($groupedArgs, $continue) = $this->runGlobalCommands($groupedArgs);
     if ($continue === false) {
         return;
     }
     try {
         list($command, $groupedArgs) = $this->argumentsMatcher->matchCommands($this->getNotGlobalCommands(), $groupedArgs);
         $command = clone $command;
         $this->runCommand($command);
     } catch (MissingCommandNameException $ex) {
         array_unshift($args, $this->getDefaultCommandName());
         $this->parseArgs($args);
     } catch (Exception $ex) {
         if ($this->getCatchErrors()) {
             $widget = new ExceptionWidget($this->input, $this->output);
             $widget->render($ex);
         } else {
             throw $ex;
         }
     }
 }