Coverage index

src/Attribute/VisitorsLocation.php

Lines: 100.00%

LineHitsSource
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Drupal\visitors\Attribute;
6
7
use Drupal\Component\Plugin\Attribute\Plugin;
8
use Drupal\Core\StringTranslation\TranslatableMarkup;
9
10
/**
11
 * Defines a location plugin attribute.
12
 *
13
 * Plugin namespace: Plugin\VisitorsLocation.
14
 *
15
 * The site selects one plugin. That plugin sets the place stored on a
16
 * visit. Other modules can add plugins in this namespace.
17
 *
18
 * @see \Drupal\visitors\VisitorsLocationPluginManager
19
 */
20
#[\Attribute(\Attribute::TARGET_CLASS)]
21
class VisitorsLocation extends Plugin {
22
23
  /**
24
   * Constructs a VisitorsLocation attribute.
25
   *
26
   * @param string $id
27
   *   The plugin ID.
28
   * @param \Drupal\Core\StringTranslation\TranslatableMarkup|string|null $label
29
   *   The human-readable name of the plugin.
30
   * @param int $weight
31
   *   The weight. Lower numbers are listed first.
32
   * @param class-string|null $deriver
33
   *   (optional) The deriver class for this plugin.
34
   */
35
  public function __construct(
36
    public readonly string $id,
37
    public readonly TranslatableMarkup|string|null $label = NULL,
38
    public readonly int $weight = 0,
39
    public readonly ?string $deriver = NULL,
4011
  ) {}
41
42
}