mediawiki-skins-Vector/includes/Components/VectorComponentMenuListItem.php
Jan Drewniak 1bcd760ecf Add missing ID param to VectorComponentMenuListItem constructor
Bug: T324638
Change-Id: I6aa81f9f9166a23100da8920069235ecba4f7594
2023-01-26 22:08:04 +00:00

36 lines
743 B
PHP

<?php
namespace MediaWiki\Skins\Vector\Components;
/**
* VectorComponentMenuListItem component
*/
class VectorComponentMenuListItem implements VectorComponent {
/** @var VectorComponentIconLink */
private $link;
/** @var string */
private $class;
/** @var string */
private $id;
/**
* @param VectorComponentIconLink $link
* @param string $class
* @param string $id
*/
public function __construct( VectorComponentIconLink $link, string $class = '', string $id = '' ) {
$this->link = $link;
$this->class = $class;
$this->id = $id;
}
/**
* @inheritDoc
*/
public function getTemplateData(): array {
return $this->link->getTemplateData() + [
'item-class' => $this->class,
'item-id' => $this->id,
];
}
}