예제 #1
0
 /**
  * Run the reactor.
  *
  * @access  public
  */
 public function run()
 {
     $this->handleCustomOptions();
     $this->output->write(PHP_EOL);
     if (($command = $this->input->getArgument(1)) === null) {
         $this->displayReactorInfo();
         $this->listCommands();
     } else {
         $this->dispatch($command);
     }
     $this->output->write(PHP_EOL);
 }
예제 #2
0
 /**
  * Displays command details.
  *
  * @access  protected
  */
 protected function displayCommandDetails()
 {
     $this->write('<yellow>Command:</yellow>');
     $this->nl();
     $this->write('php reactor ' . $this->input->getArgument(1));
     $this->nl();
     $this->write('<yellow>Description:</yellow>');
     $this->nl();
     $this->write($this->getCommandDescription());
     if (!empty($this->commandInformation['arguments'])) {
         $this->nl();
         $this->write('<yellow>Arguments:</yellow>');
         $this->nl();
         $this->drawInfoTable($this->commandInformation['arguments']);
     }
     if (!empty($this->commandInformation['options'])) {
         $this->nl();
         $this->write('<yellow>Options:</yellow>');
         $this->nl();
         $this->drawInfoTable($this->commandInformation['options']);
     }
     $this->shouldExecute = false;
 }
예제 #3
0
 /**
  *
  */
 public function testGetMissingArgument()
 {
     $reader = $this->getReader();
     $arguments = ['--foo'];
     $input = new Input($reader, $arguments);
     $this->assertSame(true, $input->getArgument('foo'));
     $this->assertSame(null, $input->getArgument('bar'));
     $this->assertSame(false, $input->getArgument('bar', false));
 }