reviewer-1.2.x-dev/src/Attribute/Review.php
src/Attribute/Review.php
<?php
declare(strict_types=1);
namespace Drupal\reviewer\Attribute;
use Drupal\Component\Plugin\Attribute\Plugin;
/**
* Attribute definition for review plugins.
*/
#[\Attribute(\Attribute::TARGET_CLASS)]
final class Review extends Plugin {
/**
* A review is a collection of checklists, run to check configuration.
*
* @param string $id
* The review plugin unique ID.
* @param string $label
* The review human-readable label.
* @param class-string<\Drupal\reviewer\Reviewer\Checklist\ChecklistInterface>[] $checklists
* Checklists this review should run.
* @param string|null $config_entity_type
* An optional config entity type to reference during review. If the config
* entity type supports bundles, then the review will check all bundles.
* @param string[] $bundles
* The bundles of the config entity type to review. Omit to test all bundles
* of the entity type, or if the entity type does not support bundles.
* @param array{id: string, reason: string}[] $ignored
* Failed tasks that should be ignored. Each item is an array with two keys:
* id (the failed task ID) and reason (the user-displayed reason for
* ignoring the item).
*/
public function __construct(
string $id,
public readonly string $label,
public readonly array $checklists,
public readonly string|null $config_entity_type = NULL,
public readonly array $bundles = [],
public readonly array $ignored = [],
) {
parent::__construct($id);
}
}
