Code Coverage
 
Lines
Branches
Paths
Functions and Methods
Classes and Traits
Total
0.00% covered (danger)
0.00%
0 / 10
0.00% covered (danger)
0.00%
0 / 10
0.00% covered (danger)
0.00%
0 / 10
0.00% covered (danger)
0.00%
0 / 10
CRAP
0.00% covered (danger)
0.00%
0 / 1
DisplayBuilderEvent
0.00% covered (danger)
0.00%
0 / 10
0.00% covered (danger)
0.00%
0 / 10
0.00% covered (danger)
0.00%
0 / 10
0.00% covered (danger)
0.00%
0 / 10
110
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
 appendResult
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
 getBuilderId
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
 getData
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
 getNodeId
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
 getIslandConfiguration
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
 getEnabledIslands
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
 getParentId
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
 getCurrentIslandId
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
 getResult
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\Event;
6
7use Drupal\Component\EventDispatcher\Event;
8
9/**
10 * Event fired when display builder is used.
11 */
12final class DisplayBuilderEvent extends Event {
13
14  /**
15   * The result for this event.
16   *
17   * A render array.
18   */
19  private array $result = [];
20
21  /**
22   * Constructs a DisplayBuilderEvent object.
23   *
24   * @param string $builder_id
25   *   The display builder ID.
26   * @param array $island_enabled
27   *   The enabled islands.
28   * @param array $island_configuration
29   *   The island configuration.
30   * @param array|null $data
31   *   The data associated with this event.
32   * @param string|null $node_id
33   *   The tree node ID.
34   * @param string|null $parent_id
35   *   The parent node ID.
36   * @param string|null $current_island_id
37   *   Optional current island ID which trigger action.
38   */
39  public function __construct(
40    private string $builder_id,
41    private array $island_enabled,
42    private array $island_configuration,
43    private ?array $data = NULL,
44    private ?string $node_id = NULL,
45    private ?string $parent_id = NULL,
46    private ?string $current_island_id = NULL,
47  ) {}
48
49  /**
50   * Append a result for this event.
51   *
52   * @param string $islandId
53   *   The island ID.
54   * @param array $result
55   *   The result array to append.
56   */
57  public function appendResult(string $islandId, array $result): void {
58    $this->result[$islandId] = $result;
59  }
60
61  /**
62   * Gets the display builder ID.
63   *
64   * @return string
65   *   The display builder ID.
66   */
67  public function getBuilderId(): string {
68    return $this->builder_id;
69  }
70
71  /**
72   * Gets the data associated with this event.
73   *
74   * @return array|null
75   *   The event data.
76   */
77  public function getData(): ?array {
78    return $this->data;
79  }
80
81  /**
82   * Gets the tree node ID.
83   *
84   * @return string
85   *   The tree node ID.
86   */
87  public function getNodeId(): ?string {
88    return $this->node_id;
89  }
90
91  /**
92   * Gets the enabled islands.
93   *
94   * @return array
95   *   The enabled islands.
96   */
97  public function getIslandConfiguration(): array {
98    return $this->island_configuration;
99  }
100
101  /**
102   * Gets the enabled islands.
103   *
104   * @return array
105   *   The enabled islands.
106   */
107  public function getEnabledIslands(): array {
108    return $this->island_enabled;
109  }
110
111  /**
112   * Gets the parent node ID.
113   *
114   * @return string
115   *   The parent node ID.
116   */
117  public function getParentId(): ?string {
118    return $this->parent_id;
119  }
120
121  /**
122   * Gets the current island ID.
123   *
124   * @return string
125   *   The current island ID which trigger action.
126   */
127  public function getCurrentIslandId(): ?string {
128    return $this->current_island_id;
129  }
130
131  /**
132   * Gets the result for this event.
133   *
134   * @return array
135   *   The result array, or empty array if not set.
136   */
137  public function getResult(): array {
138    return $this->result;
139  }
140
141}

Paths

Below are the source code lines that represent each code path as identified by Xdebug. Please note a path is not necessarily coterminous with a line, a line may contain multiple paths and therefore show up more than once. Please also be aware that some paths may include implicit rather than explicit branches, e.g. an if statement always has an else as part of its logical flow even if you didn't write one.

DisplayBuilderEvent->__construct
40    private string $builder_id,
41    private array $island_enabled,
42    private array $island_configuration,
43    private ?array $data = NULL,
44    private ?string $node_id = NULL,
45    private ?string $parent_id = NULL,
46    private ?string $current_island_id = NULL,
47  ) {}
DisplayBuilderEvent->appendResult
57  public function appendResult(string $islandId, array $result): void {
58    $this->result[$islandId] = $result;
59  }
DisplayBuilderEvent->getBuilderId
68    return $this->builder_id;
69  }
DisplayBuilderEvent->getCurrentIslandId
128    return $this->current_island_id;
129  }
DisplayBuilderEvent->getData
78    return $this->data;
79  }
DisplayBuilderEvent->getEnabledIslands
108    return $this->island_enabled;
109  }
DisplayBuilderEvent->getIslandConfiguration
98    return $this->island_configuration;
99  }
DisplayBuilderEvent->getNodeId
88    return $this->node_id;
89  }
DisplayBuilderEvent->getParentId
118    return $this->parent_id;
119  }
DisplayBuilderEvent->getResult
138    return $this->result;
139  }