Total Complexity | 3 |
Total Lines | 42 |
Duplicated Lines | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
19 | class ConnectionsMenuEvent extends Event |
||
20 | { |
||
21 | /** |
||
22 | * The full menu object |
||
23 | * |
||
24 | * @var ItemInterface |
||
25 | */ |
||
26 | private $menu; |
||
27 | |||
28 | /** |
||
29 | * The name of the extension in use |
||
30 | * |
||
31 | * @var string |
||
32 | */ |
||
33 | private $extensionName; |
||
34 | |||
35 | public function __construct(ItemInterface $menu, string $extensionName) |
||
36 | { |
||
37 | $this->extensionName = $extensionName; |
||
38 | $this->menu = $menu; |
||
39 | } |
||
40 | |||
41 | public function getExtensionName(): string |
||
42 | { |
||
43 | return $this->extensionName; |
||
44 | } |
||
45 | |||
46 | /** |
||
47 | * Add a child menu item to the connections menu |
||
48 | * |
||
49 | * Returns this event object to allow method chaining |
||
50 | * |
||
51 | * @param ItemInterface|string $child An ItemInterface instance or the name of a new item to create |
||
52 | * @param array $options If creating a new item, the options passed to the factory for the item |
||
53 | * |
||
54 | * @return $this |
||
55 | */ |
||
56 | public function addChild($child, array $options = []): self |
||
61 | } |
||
62 | } |
||
63 |