I'm using Sympfony Console as a standalone component.
Let's say I've got a Command defined as follows:
class Box extends Command
{
public function __construct() {
// removed for simplicity of this example
}
protected function configure() {
// removed for simplicity of this example
}
protected function execute(InputInterface $input, OutputInterface $output) {
if (!$data=\file_get_contents($input->getOption('inputfile'))) { return false;}
// rest of code removed for simplicity of this example
}
}
Obviously it is most likely not correct to use return false; So what is the correct way to do it, I can't seem to find a reference or example in the docs ? The nearest thing I can find is a reference to ConsoleEvents::TERMINATE but using events to achive my goal seems a bit overkill ?