Ejemplo n.º 1
0
 protected function printHelp()
 {
     $context = $this->context->getAsArray();
     $scope = $this->reflectByArgs(null, ...$context);
     $help = $this->colFormatter->format($scope, $this->_options['height_help'], $this->getScreenWidth());
     $title = $this->getHelpTitle(count($context));
     $this->writer->writeln($title, $this->_options['style.help.title']);
     $this->writer->writeln($help, $this->_options['style.help.content']);
 }
Ejemplo n.º 2
0
 /**
  * @param Context $route
  * @param array $args
  *
  * @throws ContextHandlerException
  */
 public function handle(Context $route, array $args)
 {
     $count = count($args);
     if ($count > 2) {
         throw new ContextHandlerException('Invalid format context command');
     }
     $cid = '';
     $aid = '';
     switch ($count) {
         case 1:
             $cid = $args[0];
             break;
         case 2:
             $cid = $args[0];
             $aid = $args[1];
             $route->setControllerID($args[0]);
             $route->setActionID($args[1]);
             break;
     }
     $route->setControllerID($cid);
     $route->setActionID($aid);
 }