setName('config:validate') ->setDescription($this->trans('commands.config.validate.description')) ->addArgument('config.name', InputArgument::REQUIRED); } /** * {@inheritdoc} */ 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'); if (!$typedConfigManager->hasConfigSchema($name)) { $io->warning($this->trans('commands.config.validate.messages.no-conf')); return 1; } //Get the config data from the factory $configFactory = $this->get('config.factory'); $config_data = $configFactory->get($name)->get(); return $this->printResults($this->checkConfigSchema($typedConfigManager, $name, $config_data), $io); } }