exit when Twig environment is not set
The `LintCommand` 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
1d8fc92dbe
commit
05a4602450
@ -87,6 +87,13 @@ EOF
|
|||||||
protected function execute(InputInterface $input, OutputInterface $output)
|
protected function execute(InputInterface $input, OutputInterface $output)
|
||||||
{
|
{
|
||||||
$twig = $this->getTwigEnvironment();
|
$twig = $this->getTwigEnvironment();
|
||||||
|
|
||||||
|
if (null === $twig) {
|
||||||
|
$output->writeln('<error>The Twig environment needs to be set.</error>');
|
||||||
|
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
$filename = $input->getArgument('filename');
|
$filename = $input->getArgument('filename');
|
||||||
|
|
||||||
if (!$filename) {
|
if (!$filename) {
|
||||||
|
Reference in New Issue
Block a user