5 * Contains \Drupal\Console\Command\Cache\ContextDebugCommand.
8 namespace Drupal\Console\Command\Cache;
10 use Symfony\Component\Console\Input\InputInterface;
11 use Symfony\Component\Console\Output\OutputInterface;
12 use Symfony\Component\Console\Command\Command;
13 use Drupal\Console\Core\Command\Shared\ContainerAwareCommandTrait;
14 use Drupal\Console\Core\Style\DrupalStyle;
17 * Class ContextDebugCommand.
19 * @package Drupal\Console\Command\Cache
21 class ContextDebugCommand extends Command
23 use ContainerAwareCommandTrait;
28 protected function configure()
31 ->setName('cache:context:debug')
32 ->setDescription($this->trans('commands.cache.context.debug.description'));
38 protected function execute(InputInterface $input, OutputInterface $output)
40 $io = new DrupalStyle($input, $output);
41 $contextManager = $this->get('cache_contexts_manager');
44 $this->trans('commands.cache.context.debug.messages.code'),
45 $this->trans('commands.cache.context.debug.messages.label'),
46 $this->trans('commands.cache.context.debug.messages.class'),
51 foreach ($contextManager->getAll() as $code) {
52 $context = $this->get('cache_context.'.$code);
55 $context->getLabel()->render(),
60 $io->table($tableHeader, $tableRows, 'compact');