X-Git-Url: http://www.aleph1.co.uk/gitweb/?p=yaffs-website;a=blobdiff_plain;f=vendor%2Fdrupal%2Fconsole%2Ftemplates%2Fmodule%2Fsrc%2FCommand%2Fcommand.php.twig;fp=vendor%2Fdrupal%2Fconsole%2Ftemplates%2Fmodule%2Fsrc%2FCommand%2Fcommand.php.twig;h=305095753e759265e3bb2ec8bb6db8b25af2b90a;hp=0000000000000000000000000000000000000000;hb=a2bd1bf0c2c1f1a17d188f4dc0726a45494cefae;hpb=57c063afa3f66b07c4bbddc2d6129a96d90f0aad diff --git a/vendor/drupal/console/templates/module/src/Command/command.php.twig b/vendor/drupal/console/templates/module/src/Command/command.php.twig new file mode 100644 index 000000000..305095753 --- /dev/null +++ b/vendor/drupal/console/templates/module/src/Command/command.php.twig @@ -0,0 +1,76 @@ +{% extends "base/class.php.twig" %} + +{% block file_path %} +\Drupal\{{extension}}\Command\{{ class }}. +{% endblock %} + +{% block namespace_class %} +namespace Drupal\{{extension}}\Command; +{% endblock %} + +{% 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; +{% else %} +use Drupal\Console\Core\Command\Shared\CommandTrait; +{% endif %} +use Drupal\Console\Core\Style\DrupalStyle; +use Drupal\Console\Annotations\DrupalCommand; +{% endblock %} + +{% block class_declaration %} +/** + * Class {{ class_name }}. + * + * @package Drupal\{{extension}} + * + * @DrupalCommand ( + * extension="{{extension}}", + * extensionType="{{ extensionType }}" + * ) + */ +class {{ class_name }} extends Command {% endblock %} +{% block class_construct %} +{% if services is not empty %} + + /** + * {@inheritdoc} + */ + public function __construct({{ servicesAsParameters(services)|join(', ') }}) { +{{ serviceClassInitialization(services) }} + parent::__construct(); + } +{% endif %} +{% endblock %} + +{% block use_trait %} +{% if container_aware %} + use ContainerAwareCommandTrait; +{% else %} + use CommandTrait; +{% endif %} + +{% endblock %} + +{% block class_methods %} + /** + * {@inheritdoc} + */ + protected function configure() { + $this + ->setName('{{ name }}') + ->setDescription($this->trans('commands.{{ command_key }}.description')); + } + + /** + * {@inheritdoc} + */ + protected function execute(InputInterface $input, OutputInterface $output) { + $io = new DrupalStyle($input, $output); + + $io->info($this->trans('commands.{{ command_key }}.messages.success')); + } +{%- endblock -%}