Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
TemplateHintsDisableCommand.php
Go to the documentation of this file.
1 <?php
8 
9 use Symfony\Component\Console\Command\Command;
10 use Symfony\Component\Console\Input\InputInterface;
11 use Symfony\Component\Console\Output\OutputInterface;
13 
14 class TemplateHintsDisableCommand extends Command
15 {
19  const COMMAND_NAME = 'dev:template-hints:disable';
20 
24  const SUCCESS_MESSAGE = "Template hints disabled. Refresh cache types";
25 
29  private $resourceConfig;
30 
36  public function __construct(ConfigInterface $resourceConfig)
37  {
38  parent::__construct();
39  $this->resourceConfig = $resourceConfig;
40  }
41 
45  protected function configure()
46  {
47  $this->setName(self::COMMAND_NAME)
48  ->setDescription('Disable frontend template hints. A cache flush might be required.');
49 
50  parent::configure();
51  }
52 
57  protected function execute(InputInterface $input, OutputInterface $output)
58  {
59  $this->resourceConfig->saveConfig('dev/debug/template_hints_storefront', 0, 'default', 0);
60  $output->writeln("<info>". self::SUCCESS_MESSAGE . "</info>");
61  }
62 }