Skip to content
Snippets Groups Projects

Converted plugin discovery

Merged David Cameron requested to merge issue/styleguide-3521835:3521835-plugin-discovery into 2.x
Files
9
+ 42
0
<?php
declare(strict_types=1);
namespace Drupal\styleguide\Attribute;
use Drupal\Component\Plugin\Attribute\Plugin;
use Drupal\Core\StringTranslation\TranslatableMarkup;
/**
* Defines a Styleguide attribute for plugin discovery.
*
* @see \Drupal\styleguide\StyleguideInterface
* @see \Drupal\styleguide\StyleguidePluginManager
* @see plugin_api
*/
#[\Attribute(\Attribute::TARGET_CLASS)]
class Styleguide extends Plugin {
/**
* Constructs a Styleguide attribute.
*
* @param string $id
* The plugin ID.
* @param \Drupal\Core\StringTranslation\TranslatableMarkup $label
* The label of the plugin.
* @param \Drupal\Core\StringTranslation\TranslatableMarkup|null $description
* (optional) A description of the plugin.
* @param string|null $deriver
* (optional) The deriver class.
* @param string|null $provider
* (optional) The machine name of the provider module.
*/
public function __construct(
public readonly string $id,
public readonly TranslatableMarkup $label,
public readonly ?TranslatableMarkup $description = NULL,
public readonly ?string $deriver = NULL,
public ?string $provider = NULL,
) {}
}
Loading