name = $name; $this->description = $description; $this->file = $file; parent::__construct($chainDiscovery); $this->ignoreValidationErrors(); $this->addOption( 'file', null, InputOption::VALUE_OPTIONAL, null, $file ); } /** * {@inheritdoc} */ protected function configure() { $this ->setName($this->name) ->setDescription($this->description); } /** * {@inheritdoc} */ protected function execute(InputInterface $input, OutputInterface $output) { $command = $this->getApplication()->find('chain'); $arguments = [ 'command' => 'chain', '--file' => $this->file, ]; foreach ($input->getOptions() as $option => $value) { if ($value) { $arguments['--' . $option] = $value; } } $commandInput = new ArrayInput($arguments); $commandInput->setInteractive(true); return $command->run($commandInput, $output); } }