Initial Drupal 11 with DDEV setup
This commit is contained in:
32
vendor/chi-teck/drupal-code-generator/templates/Service/_custom/custom.twig
vendored
Normal file
32
vendor/chi-teck/drupal-code-generator/templates/Service/_custom/custom.twig
vendored
Normal file
@ -0,0 +1,32 @@
|
||||
{% import '@lib/di.twig' as di %}
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Drupal\{{ machine_name }};
|
||||
|
||||
{% if services %}
|
||||
{{ di.use(services) }}
|
||||
{% endif %}
|
||||
/**
|
||||
* @todo Add class description.
|
||||
*/
|
||||
final class {{ class }}{{ interface ? ' implements ' ~ interface }} {
|
||||
{% if services %}
|
||||
|
||||
/**
|
||||
* Constructs {{ class|article }} object.
|
||||
*/
|
||||
public function __construct(
|
||||
{{ di.signature(services) }}
|
||||
) {}
|
||||
{% endif %}
|
||||
|
||||
/**
|
||||
* {{ interface ? '{@inheritdoc}' : '@todo Add method description.'}}
|
||||
*/
|
||||
public function doSomething(): void {
|
||||
// @todo Place your code here.
|
||||
}
|
||||
|
||||
}
|
||||
17
vendor/chi-teck/drupal-code-generator/templates/Service/_custom/interface.twig
vendored
Normal file
17
vendor/chi-teck/drupal-code-generator/templates/Service/_custom/interface.twig
vendored
Normal file
@ -0,0 +1,17 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Drupal\{{ machine_name }};
|
||||
|
||||
/**
|
||||
* @todo Add interface description.
|
||||
*/
|
||||
interface {{ interface }} {
|
||||
|
||||
/**
|
||||
* @todo Add method description.
|
||||
*/
|
||||
public function doSomething(): void;
|
||||
|
||||
}
|
||||
7
vendor/chi-teck/drupal-code-generator/templates/Service/_custom/services.twig
vendored
Normal file
7
vendor/chi-teck/drupal-code-generator/templates/Service/_custom/services.twig
vendored
Normal file
@ -0,0 +1,7 @@
|
||||
{% import '@lib/di.twig' as di %}
|
||||
services:
|
||||
{{ service_name }}:
|
||||
class: Drupal\{{ machine_name }}\{{ class }}
|
||||
{% if services %}
|
||||
arguments: [{{ di.arguments(services) }}]
|
||||
{% endif %}
|
||||
Reference in New Issue
Block a user