Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[generate:command] Extend base commands. #3459

Merged
merged 1 commit into from
Jul 29, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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