Code Coverage
 
Lines
Functions and Methods
Classes and Traits
Total
0.00% covered (danger)
0.00%
0 / 7
0.00% covered (danger)
0.00%
0 / 2
CRAP
0.00% covered (danger)
0.00%
0 / 1
VectorComponentMenuListItem
0.00% covered (danger)
0.00%
0 / 7
0.00% covered (danger)
0.00%
0 / 2
6
0.00% covered (danger)
0.00%
0 / 1
 __construct
0.00% covered (danger)
0.00%
0 / 3
0.00% covered (danger)
0.00%
0 / 1
2
 getTemplateData
0.00% covered (danger)
0.00%
0 / 4
0.00% covered (danger)
0.00%
0 / 1
2
1<?php
2namespace MediaWiki\Skins\Vector\Components;
3
4/**
5 * VectorComponentMenuListItem component
6 */
7class 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}