From 5d564f37b8817749d9bcf578e1ba6ec2bc6d2232 Mon Sep 17 00:00:00 2001 From: Jesus Manuel Olivas Date: Sat, 29 Jul 2017 11:14:38 -0700 Subject: [PATCH] [generate:command] Extend base commands. --- templates/module/src/Command/command.php.twig | 15 +++------------ 1 file changed, 3 insertions(+), 12 deletions(-) diff --git a/templates/module/src/Command/command.php.twig b/templates/module/src/Command/command.php.twig index bbe779678..6e8b99fa8 100644 --- a/templates/module/src/Command/command.php.twig +++ b/templates/module/src/Command/command.php.twig @@ -13,9 +13,9 @@ 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; @@ -30,7 +30,7 @@ use Drupal\Console\Annotations\DrupalCommand; * extensionType="{{ extensionType }}" * ) */ -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 %} @@ -44,15 +44,6 @@ class {{ class_name }} extends Command {% endblock %} {% endif %} {% endblock %} -{% block use_trait %} -{% if container_aware %} - use ContainerAwareCommandTrait; -{% else %} - use CommandTrait; -{% endif %} - -{% endblock %} - {% block class_methods %} /** * {@inheritdoc}