Initial Drupal 11 with DDEV setup
This commit is contained in:
47
vendor/chi-teck/drupal-code-generator/templates/Drush/_symfony-command/command.twig
vendored
Normal file
47
vendor/chi-teck/drupal-code-generator/templates/Drush/_symfony-command/command.twig
vendored
Normal file
@ -0,0 +1,47 @@
|
||||
{% import '@lib/di.twig' as di %}
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Drupal\{{ machine_name }}\Command;
|
||||
|
||||
{% apply sort_namespaces %}
|
||||
use Symfony\Component\Console\Attribute\AsCommand;
|
||||
use Symfony\Component\Console\Command\Command;
|
||||
use Symfony\Component\Console\Input\InputInterface;
|
||||
use Symfony\Component\Console\Output\OutputInterface;
|
||||
{% if services %}
|
||||
{{ di.use(services) }}
|
||||
{% endif %}
|
||||
{% endapply %}
|
||||
|
||||
// phpcs:disable Drupal.Commenting.ClassComment.Missing
|
||||
#[AsCommand(
|
||||
name: '{{ command.name }}',
|
||||
description: '{{ command.description }}',
|
||||
aliases: ['{{ command.alias }}'],
|
||||
)]
|
||||
final class {{ class }} extends Command {
|
||||
{% if services %}
|
||||
|
||||
/**
|
||||
* Constructs {{ class|article }} object.
|
||||
*/
|
||||
public function __construct(
|
||||
{{ di.signature(services) }}
|
||||
) {
|
||||
{# Parent constructor configures the command. #}
|
||||
parent::__construct();
|
||||
}
|
||||
{% endif %}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
protected function execute(InputInterface $input, OutputInterface $output): int {
|
||||
// @todo Place your code here.
|
||||
$output->writeln('<info>It works!</info>');
|
||||
return self::SUCCESS;
|
||||
}
|
||||
|
||||
}
|
||||
9
vendor/chi-teck/drupal-code-generator/templates/Drush/_symfony-command/services.twig
vendored
Normal file
9
vendor/chi-teck/drupal-code-generator/templates/Drush/_symfony-command/services.twig
vendored
Normal file
@ -0,0 +1,9 @@
|
||||
{% import '@lib/di.twig' as di %}
|
||||
services:
|
||||
{{ service_name }}:
|
||||
class: Drupal\{{ machine_name }}\Command\{{ class }}
|
||||
{% if services %}
|
||||
arguments: [{{ di.arguments(services) }}]
|
||||
{% endif %}
|
||||
tags:
|
||||
- { name: console.command }
|
||||
Reference in New Issue
Block a user