Skip to content

Commit

Permalink
[generate:command] Extend base commands. (#3459)
Browse files Browse the repository at this point in the history
  • Loading branch information
jmolivas authored Jul 29, 2017
1 parent fe6c8ea commit c3b2684
Showing 1 changed file with 3 additions and 12 deletions.
15 changes: 3 additions & 12 deletions templates/module/src/Command/command.php.twig
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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 %}

Expand All @@ -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}
Expand Down

0 comments on commit c3b2684

Please sign in to comment.