{% block use_class %}
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Output\OutputInterface;
-use Symfony\Component\Console\Command\Command;
{% if container_aware %}
-use Drupal\Console\Core\Command\Shared\ContainerAwareCommandTrait;
+use Drupal\Console\Core\Command\ContainerAwareCommand;
{% else %}
-use Drupal\Console\Core\Command\Shared\CommandTrait;
+use Drupal\Console\Core\Command\Command;
{% endif %}
-use Drupal\Console\Core\Style\DrupalStyle;
use Drupal\Console\Annotations\DrupalCommand;
{% endblock %}
/**
* Class {{ class_name }}.
*
- * @package Drupal\{{extension}}
- *
* @DrupalCommand (
* extension="{{extension}}",
- * extensionType="{{ extensionType }}"
+ * extensionType="{{ extension_type }}"
* )
*/
-class {{ class_name }} extends Command {% endblock %}
+class {{ class_name }} extends {% if container_aware %}ContainerAwareCommand{% else %}Command{% endif %} {% endblock %}
{% block class_construct %}
{% if services is not empty %}
{% endif %}
{% endblock %}
-{% block use_trait %}
-{% if container_aware %}
- use ContainerAwareCommandTrait;
-{% else %}
- use CommandTrait;
-{% endif %}
-
-{% endblock %}
-
{% block class_methods %}
/**
* {@inheritdoc}
->setDescription($this->trans('commands.{{ command_key }}.description'));
}
+{% if initialize %}
+ /**
+ * {@inheritdoc}
+ */
+ protected function initialize(InputInterface $input, OutputInterface $output) {
+ parent::initialize($input, $output);
+ $this->getIo()->info('initialize');
+ }
+
+{% endif %}
+{% if interact %}
+ /**
+ * {@inheritdoc}
+ */
+ protected function interact(InputInterface $input, OutputInterface $output) {
+ $this->getIo()->info('interact');
+ }
+
+{% endif %}
/**
* {@inheritdoc}
*/
protected function execute(InputInterface $input, OutputInterface $output) {
- $io = new DrupalStyle($input, $output);
-
- $io->info($this->trans('commands.{{ command_key }}.messages.success'));
+ $this->getIo()->info('execute');
+ $this->getIo()->info($this->trans('commands.{{ command_key }}.messages.success'));
+{% if class_generator %}
+ $this->generator->generate([]);
+{% endif %}
}
+
{%- endblock -%}