Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
Total | |
0.00% |
0 / 6 |
|
0.00% |
0 / 2 |
CRAP | |
0.00% |
0 / 1 |
ChangesListStringOptionsFilter | |
0.00% |
0 / 6 |
|
0.00% |
0 / 2 |
12 | |
0.00% |
0 / 1 |
displaysOnUnstructuredUi | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
isSelected | |
0.00% |
0 / 5 |
|
0.00% |
0 / 1 |
6 |
1 | <?php |
2 | |
3 | use MediaWiki\Html\FormOptions; |
4 | |
5 | /** |
6 | * An individual filter in a ChangesListStringOptionsFilterGroup. |
7 | * |
8 | * This filter type will only be displayed on the structured UI currently. |
9 | * |
10 | * @since 1.29 |
11 | */ |
12 | class ChangesListStringOptionsFilter extends ChangesListFilter { |
13 | /** |
14 | * @inheritDoc |
15 | */ |
16 | public function displaysOnUnstructuredUi() { |
17 | return false; |
18 | } |
19 | |
20 | /** |
21 | * @inheritDoc |
22 | */ |
23 | public function isSelected( FormOptions $opts ) { |
24 | $option = $opts[ $this->getGroup()->getName() ]; |
25 | if ( $option === ChangesListStringOptionsFilterGroup::ALL ) { |
26 | return true; |
27 | } |
28 | |
29 | $values = explode( ChangesListStringOptionsFilterGroup::SEPARATOR, $option ); |
30 | return in_array( $this->getName(), $values ); |
31 | } |
32 | } |