X-Git-Url: http://www.aleph1.co.uk/gitweb/?a=blobdiff_plain;f=vendor%2Fdrupal%2Fconsole%2Fsrc%2FCommand%2FConfig%2FValidateCommand.php;fp=vendor%2Fdrupal%2Fconsole%2Fsrc%2FCommand%2FConfig%2FValidateCommand.php;h=10b2091e43254298e9efd0bfbf586a892431c5b8;hb=9917807b03b64faf00f6a1f29dcb6eafc454efa5;hp=3c8934558cebd184eb603e1c1a99500acd0104ba;hpb=aea91e65e895364e460983b890e295aa5d5540a5;p=yaffs-website diff --git a/vendor/drupal/console/src/Command/Config/ValidateCommand.php b/vendor/drupal/console/src/Command/Config/ValidateCommand.php index 3c8934558..10b2091e4 100644 --- a/vendor/drupal/console/src/Command/Config/ValidateCommand.php +++ b/vendor/drupal/console/src/Command/Config/ValidateCommand.php @@ -9,9 +9,7 @@ namespace Drupal\Console\Command\Config; use Symfony\Component\Console\Input\InputInterface; use Symfony\Component\Console\Output\OutputInterface; -use Symfony\Component\Console\Command\Command; -use Drupal\Console\Core\Command\Shared\ContainerAwareCommandTrait; -use Drupal\Console\Core\Style\DrupalStyle; +use Drupal\Console\Core\Command\ContainerAwareCommand; use Drupal\Core\Config\TypedConfigManagerInterface; use Symfony\Component\Console\Input\InputArgument; use Drupal\Core\Config\Schema\SchemaCheckTrait; @@ -21,9 +19,8 @@ use Drupal\Core\Config\Schema\SchemaCheckTrait; * * @package Drupal\Console\Command\Config */ -class ValidateCommand extends Command +class ValidateCommand extends ContainerAwareCommand { - use ContainerAwareCommandTrait; use SchemaCheckTrait; use PrintConfigValidationTrait; @@ -35,7 +32,10 @@ class ValidateCommand extends Command $this ->setName('config:validate') ->setDescription($this->trans('commands.config.validate.description')) - ->addArgument('config.name', InputArgument::REQUIRED); + ->addArgument( + 'name', + InputArgument::REQUIRED + )->setAliases(['cv']); } /** @@ -43,18 +43,15 @@ class ValidateCommand extends Command */ protected function execute(InputInterface $input, OutputInterface $output) { - /** * @var TypedConfigManagerInterface $typedConfigManager */ $typedConfigManager = $this->get('config.typed'); - $io = new DrupalStyle($input, $output); - //Test the config name and see if a schema exists, if not it will fail - $name = $input->getArgument('config.name'); + $name = $input->getArgument('name'); if (!$typedConfigManager->hasConfigSchema($name)) { - $io->warning($this->trans('commands.config.validate.messages.no-conf')); + $this->getIo()->warning($this->trans('commands.config.validate.messages.no-conf')); return 1; } @@ -62,6 +59,6 @@ class ValidateCommand extends Command $configFactory = $this->get('config.factory'); $config_data = $configFactory->get($name)->get(); - return $this->printResults($this->checkConfigSchema($typedConfigManager, $name, $config_data), $io); + return $this->printResults($this->checkConfigSchema($typedConfigManager, $name, $config_data)); } }