exit when Twig environment is not set
The `DebugCommand` from the TwigBridge requires the `Twig_Environment` to be set. Thus, if the `setTwigEnvironment()` were not called, the command execution would have been aborted with a PHP error.
This commit is contained in:
parent
40854edb1f
commit
1cfc1b7fe7
|
@ -83,6 +83,13 @@ EOF
|
|||
protected function execute(InputInterface $input, OutputInterface $output)
|
||||
{
|
||||
$twig = $this->getTwigEnvironment();
|
||||
|
||||
if (null === $twig) {
|
||||
$output->writeln('<error>The Twig environment needs to be set.</error>');
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
$types = array('functions', 'filters', 'tests', 'globals');
|
||||
|
||||
if ($input->getOption('format') === 'json') {
|
||||
|
|
Reference in New Issue