You are here

private function LintCommand::display in Twig Tweak 3.x

Same name and namespace in other branches
  1. 3.1.x src/Command/LintCommand.php \Drupal\twig_tweak\Command\LintCommand::display()
1 call to LintCommand::display()
LintCommand::execute in src/Command/LintCommand.php

File

src/Command/LintCommand.php, line 172

Class

LintCommand
Command that will validate your template syntax and output encountered errors.

Namespace

Drupal\twig_tweak\Command

Code

private function display(InputInterface $input, OutputInterface $output, SymfonyStyle $io, array $files) {
  switch ($input
    ->getOption('format')) {
    case 'txt':
      return $this
        ->displayTxt($output, $io, $files);
    case 'json':
      return $this
        ->displayJson($output, $files);
    default:
      throw new InvalidArgumentException(sprintf('The format "%s" is not supported.', $input
        ->getOption('format')));
  }
}