1 {% extends "base/class.php.twig" %}
4 \Drupal\{{extension}}\Command\{{ class }}.
7 {% block namespace_class %}
8 namespace Drupal\{{extension}}\Command;
12 use Symfony\Component\Console\Input\InputInterface;
13 use Symfony\Component\Console\Output\OutputInterface;
14 use Symfony\Component\Console\Command\Command;
15 {% if container_aware %}
16 use Drupal\Console\Core\Command\Shared\ContainerAwareCommandTrait;
18 use Drupal\Console\Core\Command\Shared\CommandTrait;
20 use Drupal\Console\Core\Style\DrupalStyle;
21 use Drupal\Console\Annotations\DrupalCommand;
24 {% block class_declaration %}
26 * Class {{ class_name }}.
28 * @package Drupal\{{extension}}
31 * extension="{{extension}}",
32 * extensionType="{{ extensionType }}"
35 class {{ class_name }} extends Command {% endblock %}
36 {% block class_construct %}
37 {% if services is not empty %}
40 * Constructs a new {{ class_name }} object.
42 public function __construct({{ servicesAsParameters(services)|join(', ') }}) {
43 {{ serviceClassInitialization(services) }}
44 parent::__construct();
50 {% if container_aware %}
51 use ContainerAwareCommandTrait;
58 {% block class_methods %}
62 protected function configure() {
64 ->setName('{{ name }}')
65 ->setDescription($this->trans('commands.{{ command_key }}.description'));
71 protected function execute(InputInterface $input, OutputInterface $output) {
72 $io = new DrupalStyle($input, $output);
74 $io->info($this->trans('commands.{{ command_key }}.messages.success'));