Skip to content

Commit c3b2684

Browse files
authored
[generate:command] Extend base commands. (#3459)
1 parent fe6c8ea commit c3b2684

File tree

1 file changed

+3
-12
lines changed

1 file changed

+3
-12
lines changed

templates/module/src/Command/command.php.twig

Lines changed: 3 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,9 @@ use Symfony\Component\Console\Input\InputInterface;
1313
use Symfony\Component\Console\Output\OutputInterface;
1414
use Symfony\Component\Console\Command\Command;
1515
{% if container_aware %}
16-
use Drupal\Console\Core\Command\Shared\ContainerAwareCommandTrait;
16+
use Drupal\Console\Core\Command\ContainerAwareCommand;
1717
{% else %}
18-
use Drupal\Console\Core\Command\Shared\CommandTrait;
18+
use Drupal\Console\Core\Command\Command;
1919
{% endif %}
2020
use Drupal\Console\Core\Style\DrupalStyle;
2121
use Drupal\Console\Annotations\DrupalCommand;
@@ -30,7 +30,7 @@ use Drupal\Console\Annotations\DrupalCommand;
3030
* extensionType="{{ extensionType }}"
3131
* )
3232
*/
33-
class {{ class_name }} extends Command {% endblock %}
33+
class {{ class_name }} extends {% if container_aware %}ContainerAwareCommand{% else %}Command{% endif %} {% endblock %}
3434
{% block class_construct %}
3535
{% if services is not empty %}
3636

@@ -44,15 +44,6 @@ class {{ class_name }} extends Command {% endblock %}
4444
{% endif %}
4545
{% endblock %}
4646

47-
{% block use_trait %}
48-
{% if container_aware %}
49-
use ContainerAwareCommandTrait;
50-
{% else %}
51-
use CommandTrait;
52-
{% endif %}
53-
54-
{% endblock %}
55-
5647
{% block class_methods %}
5748
/**
5849
* {@inheritdoc}

0 commit comments

Comments
 (0)