/** * 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); }
/** * 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; }
/** * */ 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)); }