ValidateCommand.php in Twig Tweak 3.1.x
File
src/Command/ValidateCommand.php
View source
<?php
namespace Drupal\twig_tweak\Command;
use Symfony\Component\Finder\Finder;
final class ValidateCommand extends LintCommand {
protected static $defaultName = 'twig-tweak:validate';
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
);
}
}