From 326c45b0faabe572eea877457240a7ea75fc0398 Mon Sep 17 00:00:00 2001 From: Chi Date: Fri, 11 Dec 2020 06:17:05 +0000 Subject: [PATCH] Rename twig-validate command class --- drush.services.yml | 4 ++-- .../{TwigLintCommand.php => ValidateCommand.php} | 11 +++++------ 2 files changed, 7 insertions(+), 8 deletions(-) rename src/Command/{TwigLintCommand.php => ValidateCommand.php} (83%) diff --git a/drush.services.yml b/drush.services.yml index db24098..6cfc0aa 100644 --- a/drush.services.yml +++ b/drush.services.yml @@ -1,6 +1,6 @@ services: - twig_tweak.lint: - class: Drupal\twig_tweak\Command\TwigLintCommand + twig_tweak.validate: + class: Drupal\twig_tweak\Command\ValidateCommand arguments: ['@twig'] tags: - { name: console.command } diff --git a/src/Command/TwigLintCommand.php b/src/Command/ValidateCommand.php similarity index 83% rename from src/Command/TwigLintCommand.php rename to src/Command/ValidateCommand.php index e95c651..57c6645 100644 --- a/src/Command/TwigLintCommand.php +++ b/src/Command/ValidateCommand.php @@ -7,7 +7,7 @@ use Symfony\Component\Finder\Finder; /** * Implements twig-tweak:lint console command. */ -final class TwigLintCommand extends LintCommand { +final class ValidateCommand extends LintCommand { /** * {@inheritdoc} @@ -25,14 +25,13 @@ final class TwigLintCommand extends LintCommand { parent::configure(); $this->setAliases(['twig-validate']); - - $help = <<< 'TEXT' + $this->setHelp( + $this->getHelp() . <<< 'TEXT' This command only validates Twig Syntax. For checking code style consider using friendsoftwig/twigcs package. - TEXT; - - $this->setHelp($this->getHelp() . $help); + TEXT + ); } }