Skip to content
Snippets Groups Projects

Issue #3502125: Add possibility of using Attributes instead of plugin annotation

2 files
+ 31
0
Compare changes
  • Side-by-side
  • Inline
Files
2
+ 30
0
<?php
namespace Drupal\fapi_validation\Attribute;
use Drupal\Component\Plugin\Attribute\Plugin;
use Drupal\Core\StringTranslation\TranslatableMarkup;
/**
* Defines a FAPI Validation Filter attribute for plugin discovery.
*/
#[\Attribute(\Attribute::TARGET_CLASS)]
class FapiValidationFilter extends Plugin {
/**
* Constructs a FapiValidationFilter attribute.
*
* @param string $id
* The plugin ID.
* @param \Drupal\Core\StringTranslation\TranslatableMarkup|null $label
* (optional) The human-readable name of the filter type.
* @param \Drupal\Core\StringTranslation\TranslatableMarkup|null $description
* (optional) A short description of the filter type.
*/
public function __construct(
public readonly string $id,
public readonly ?TranslatableMarkup $label = NULL,
public readonly ?TranslatableMarkup $description = NULL,
) {}
}
Loading