Skip to content
Snippets Groups Projects

Issue #3457976: [10.3] Convert DataFilter plugins and discovery to attributes

Merged Tim Rohaly requested to merge issue/typed_data-3457976:3457976-10.3-convert-datafilter into 2.1.x
Files
12
+ 35
0
<?php
declare(strict_types=1);
namespace Drupal\typed_data\Attribute;
use Drupal\Component\Plugin\Attribute\Plugin;
use Drupal\Core\StringTranslation\TranslatableMarkup;
/**
* PHP Attribute class for typed data filter plugins.
*/
#[\Attribute(\Attribute::TARGET_CLASS)]
class DataFilter extends Plugin {
/**
* Constructs a typed data filter attribute object.
*
* @param string $id
* The plugin ID. The machine-name of the data filter.
* @param \Drupal\Core\StringTranslation\TranslatableMarkup|null $label
* (optional) The human-readable name of the data filter.
* @param \Drupal\Core\StringTranslation\TranslatableMarkup|null $description
* (optional) A short description of the data filter.
* @param class-string|null $deriver
* (optional) The deriver class.
*/
public function __construct(
public readonly string $id,
public readonly ?TranslatableMarkup $label = NULL,
public readonly ?TranslatableMarkup $description = NULL,
public readonly ?string $deriver = NULL,
) {}
}
Loading