Initial Drupal 11 with DDEV setup

This commit is contained in:
gluebox
2025-10-08 11:39:17 -04:00
commit 89ef74b305
25344 changed files with 2599172 additions and 0 deletions

View File

@ -0,0 +1,62 @@
{% import '@lib/di.twig' as di %}
<?php
declare(strict_types=1);
namespace Drupal\{{ machine_name }}\EventSubscriber;
{% apply sort_namespaces %}
{% if services %}
{{ di.use(services) }}
{% endif %}
use Symfony\Component\EventDispatcher\EventSubscriberInterface;
use Symfony\Component\HttpKernel\Event\RequestEvent;
use Symfony\Component\HttpKernel\Event\ResponseEvent;
use Symfony\Component\HttpKernel\KernelEvents;
{% endapply %}
/**
* @todo Add description for this subscriber.
*/
final class {{ class }} implements EventSubscriberInterface {
{% if services %}
/**
* Constructs {{ class|article }} object.
*/
public function __construct(
{{ di.signature(services) }}
) {}
{% endif %}
/**
* Kernel request event handler.
*/
public function onKernelRequest(RequestEvent $event): void {
// @todo Place your code here.
{% if SUT_TEST %}
$this->messenger->addStatus(__FUNCTION__);
{% endif %}
}
/**
* Kernel response event handler.
*/
public function onKernelResponse(ResponseEvent $event): void {
// @todo Place your code here.
{% if SUT_TEST %}
$this->messenger->addStatus(__FUNCTION__);
{% endif %}
}
/**
* {@inheritdoc}
*/
public static function getSubscribedEvents(): array {
return [
KernelEvents::REQUEST => ['onKernelRequest'],
KernelEvents::RESPONSE => ['onKernelResponse'],
];
}
}

View File

@ -0,0 +1,9 @@
{% import '@lib/di.twig' as di %}
services:
{{ machine_name }}.event_subscriber:
class: Drupal\{{ machine_name }}\EventSubscriber\{{ class }}
{% if services %}
arguments: [{{ di.arguments(services) }}]
{% endif %}
tags:
- { name: event_subscriber }