You are here

protected function ValidateCommand::configure in Twig Tweak 3.x

Same name and namespace in other branches
  1. 3.1.x src/Command/ValidateCommand.php \Drupal\twig_tweak\Command\ValidateCommand::configure()

Overrides LintCommand::configure

File

src/Command/ValidateCommand.php, line 20

Class

ValidateCommand
Implements twig-tweak:lint console command.

Namespace

Drupal\twig_tweak\Command

Code

protected function configure() : void {
  if (!\class_exists(Finder::class)) {
    throw new \LogicException('To validate Twig templates you must install symfony/finder component.');
  }
  parent::configure();
  $this
    ->setAliases([
    'twig-validate',
  ]);
  $this
    ->setHelp($this
    ->getHelp() . <<<'TEXT'

      This command only validates Twig Syntax. For checking code style
      consider using <info>friendsoftwig/twigcs</info> package.
TEXT
);
}