<?php

declare(strict_types=1);

namespace Drupal\flowdrop\Attribute;

use Drupal\Component\Plugin\Attribute\Plugin;
use Drupal\Core\StringTranslation\TranslatableMarkup;

/**
 * Attribute for ExpressionEvaluator plugins.
 *
 * @see \Drupal\flowdrop\Plugin\ExpressionEvaluator\ExpressionEvaluatorInterface
 * @see \Drupal\flowdrop\Service\ExpressionEvaluatorPluginManager
 *
 * @api
 */
#[\Attribute(\Attribute::TARGET_CLASS)]
final class ExpressionEvaluator extends Plugin {

  /**
   * Constructs a new ExpressionEvaluator attribute.
   *
   * @param string $id
   *   The plugin ID.
   * @param \Drupal\Core\StringTranslation\TranslatableMarkup $label
   *   The human-readable label.
   * @param \Drupal\Core\StringTranslation\TranslatableMarkup|string $description
   *   The evaluator description.
   */
  public function __construct(
    public readonly string $id,
    public readonly TranslatableMarkup $label,
    public readonly TranslatableMarkup|string $description = "",
  ) {}

}
