Debian Codegraph @

skins/Vector/includes/Components/VectorComponentMenuListItem.php

raw symbols SCIP
1 <?php
2 namespace MediaWiki\Skins\Vector\Components;
3
4 /**
5 * VectorComponentMenuListItem component
6 */
7 class VectorComponentMenuListItem implements VectorComponent {
8 /** @var VectorComponentLink */
9 private $link;
10 /** @var string */
11 private $class;
12 /** @var string */
13 private $id;
14
15 /**
16 * @param VectorComponentLink $link
17 * @param string $class
18 * @param string $id
19 */
20 public function __construct( VectorComponentLink $link, string $class = '', string $id = '' ) {
21 $this->link = $link;
22 $this->class = $class;
23 $this->id = $id;
24 }
25
26 /**
27 * @inheritDoc
28 */
29 public function getTemplateData(): array {
30 return $this->link->getTemplateData() + [
31 'item-class' => $this->class,
32 'item-id' => $this->id,
33 ];
34 }
35 }