Code Coverage
 
Lines
Branches
Paths
Functions and Methods
Classes and Traits
Total
0.00% covered (danger)
0.00%
0 / 1
0.00% covered (danger)
0.00%
0 / 1
0.00% covered (danger)
0.00%
0 / 1
0.00% covered (danger)
0.00%
0 / 1
CRAP
0.00% covered (danger)
0.00%
0 / 1
Island
0.00% covered (danger)
0.00%
0 / 1
0.00% covered (danger)
0.00%
0 / 1
0.00% covered (danger)
0.00%
0 / 1
0.00% covered (danger)
0.00%
0 / 1
2
0.00% covered (danger)
0.00%
0 / 1
 __construct
0.00% covered (danger)
0.00%
0 / 1
0.00% covered (danger)
0.00%
0 / 1
0.00% covered (danger)
0.00%
0 / 1
0.00% covered (danger)
0.00%
0 / 1
2
1<?php
2
3declare(strict_types=1);
4
5namespace Drupal\display_builder\Attribute;
6
7use Drupal\Component\Plugin\Attribute\AttributeBase;
8use Drupal\Core\StringTranslation\TranslatableMarkup;
9use Drupal\display_builder\Island\IslandType;
10
11/**
12 * The island attribute.
13 */
14#[\Attribute(\Attribute::TARGET_CLASS)]
15final class Island extends AttributeBase {
16
17  /**
18   * Constructs a new Island instance.
19   *
20   * @param string $id
21   *   The plugin ID. There are some implementation bugs that make the plugin
22   *   available only if the ID follows a specific pattern. It must be either
23   *   identical to group or prefixed with the group. E.g. if the group is "foo"
24   *   the ID must be either "foo" or "foo:bar".
25   * @param \Drupal\Core\StringTranslation\TranslatableMarkup|null $label
26   *   (Optional) The human-readable name of the plugin.
27   * @param bool $enabled_by_default
28   *   Island is enabled by default on new configuration. Default: False.
29   * @param \Drupal\Core\StringTranslation\TranslatableMarkup|null $description
30   *   (Optional) A brief description of the plugin.
31   * @param class-string|null $deriver
32   *   (Optional) The deriver class.
33   * @param \Drupal\display_builder\Island\IslandType|null $type
34   *   (Optional) The island type from enumeration.
35   * @param string|null $default_region
36   *   (Optional) The island default region, if applicable.
37   * @param string|null $icon
38   *   (Optional) Icon for this island.
39   * @param array $modules
40   *   (Optional) List of other modules required for this Island.
41   * @param array $attach_to
42   *   (Optional) For IslandType::Floating islands only: the plugin IDs of
43   *   the View islands this floating control attaches to. It renders once
44   *   per listed island, alongside that island's own content, and is only
45   *   visible while that island's main tab is active. Not admin-configurable
46   *   - unlike default_region, this is a fixed part of the plugin
47   *   definition, since a floating control is usually meaningless outside
48   *   the island(s) it was built for (e.g. CSS scoped to that island).
49   */
50  public function __construct(
51    public readonly string $id,
52    public readonly ?TranslatableMarkup $label,
53    public readonly bool $enabled_by_default = FALSE,
54    public readonly ?TranslatableMarkup $description = NULL,
55    public readonly ?string $deriver = NULL,
56    public readonly ?IslandType $type = NULL,
57    public readonly ?string $default_region = NULL,
58    public readonly ?string $icon = NULL,
59    public readonly array $modules = [],
60    public readonly array $attach_to = [],
61  ) {}
62
63}