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,4 @@
services:
plugin.manager.{{ plugin_type }}:
class: Drupal\{{ machine_name }}\{{ class_prefix }}PluginManager
parent: default_plugin_manager

View File

@ -0,0 +1,35 @@
<?php
declare(strict_types=1);
namespace Drupal\{{ machine_name }}\Annotation;
use Drupal\Component\Annotation\Plugin;
/**
* Defines {{ plugin_type }} annotation object.
*
* @Annotation
*/
final class {{ class_prefix }} extends Plugin {
/**
* The plugin ID.
*/
public readonly string $id;
/**
* The human-readable name of the plugin.
*
* @ingroup plugin_translatable
*/
public readonly string $title;
/**
* The description of the plugin.
*
* @ingroup plugin_translatable
*/
public readonly string $description;
}

View File

@ -0,0 +1,17 @@
<?php
declare(strict_types=1);
namespace Drupal\{{ machine_name }};
/**
* Interface for {{ plugin_type }} plugins.
*/
interface {{ class_prefix }}Interface {
/**
* Returns the translated plugin label.
*/
public function label(): string;
}

View File

@ -0,0 +1,22 @@
<?php
declare(strict_types=1);
namespace Drupal\{{ machine_name }};
use Drupal\Component\Plugin\PluginBase;
/**
* Base class for {{ plugin_type }} plugins.
*/
abstract class {{ class_prefix }}PluginBase extends PluginBase implements {{ class_prefix }}Interface {
/**
* {@inheritdoc}
*/
public function label(): string {
// Cast the label to a string since it is a TranslatableMarkup object.
return (string) $this->pluginDefinition['label'];
}
}

View File

@ -0,0 +1,28 @@
<?php
declare(strict_types=1);
namespace Drupal\{{ machine_name }};
{% apply sort_namespaces %}
use Drupal\Core\Cache\CacheBackendInterface;
use Drupal\Core\Extension\ModuleHandlerInterface;
use Drupal\Core\Plugin\DefaultPluginManager;
use Drupal\{{ machine_name }}\Annotation\{{ class_prefix }};
{% endapply %}
/**
* {{ class_prefix }} plugin manager.
*/
final class {{ class_prefix }}PluginManager extends DefaultPluginManager {
/**
* Constructs the object.
*/
public function __construct(\Traversable $namespaces, CacheBackendInterface $cache_backend, ModuleHandlerInterface $module_handler) {
parent::__construct('Plugin/{{ class_prefix }}', $namespaces, $module_handler, {{ class_prefix }}Interface::class, {{ class_prefix }}::class);
$this->alterInfo('{{ plugin_type }}_info');
$this->setCacheBackend($cache_backend, '{{ plugin_type }}_plugins');
}
}

View File

@ -0,0 +1,20 @@
<?php
declare(strict_types=1);
namespace Drupal\{{ machine_name }}\Plugin\{{ class_prefix }};
use Drupal\{{ machine_name }}\{{ class_prefix }}PluginBase;
/**
* Plugin implementation of the {{ plugin_type }}.
*
* @{{ class_prefix }}(
* id = "foo",
* label = @Translation("Foo"),
* description = @Translation("Foo description.")
* )
*/
final class Foo extends {{ class_prefix }}PluginBase {
}