You are here

final class ValidateCommand in Twig Tweak 3.1.x

Same name and namespace in other branches
  1. 3.x src/Command/ValidateCommand.php \Drupal\twig_tweak\Command\ValidateCommand

Implements twig-tweak:lint console command.

Hierarchy

  • class \Drupal\twig_tweak\Command\LintCommand extends \Symfony\Component\Console\Command\Command

Expanded class hierarchy of ValidateCommand

1 string reference to 'ValidateCommand'
drush.services.yml in ./drush.services.yml
drush.services.yml
1 service uses ValidateCommand
twig_tweak.validate in ./drush.services.yml
Drupal\twig_tweak\Command\ValidateCommand

File

src/Command/ValidateCommand.php, line 10

Namespace

Drupal\twig_tweak\Command
View source
final class ValidateCommand extends LintCommand {

  /**
   * {@inheritdoc}
   */
  protected static $defaultName = 'twig-tweak:validate';

  /**
   * {@inheritdoc}
   */
  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
);
  }

}

Members

Namesort descending Modifiers Type Description Overrides
LintCommand::$twig private property
LintCommand::display private function
LintCommand::displayJson private function
LintCommand::displayTxt private function
LintCommand::execute protected function
LintCommand::findFiles protected function
LintCommand::getContext private function
LintCommand::getFilesInfo private function
LintCommand::renderException private function
LintCommand::validate private function
LintCommand::__construct public function
ValidateCommand::$defaultName protected static property Overrides LintCommand::$defaultName
ValidateCommand::configure protected function Overrides LintCommand::configure