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 / 3
CRAP
0.00% covered (danger)
0.00%
0 / 1
MessageGroupStates
0.00% covered (danger)
0.00%
0 / 6
0.00% covered (danger)
0.00%
0 / 3
12
0.00% covered (danger)
0.00%
0 / 1
 __construct
0.00% covered (danger)
0.00%
0 / 1
0.00% covered (danger)
0.00%
0 / 1
2
 getStates
0.00% covered (danger)
0.00%
0 / 3
0.00% covered (danger)
0.00%
0 / 1
2
 getConditions
0.00% covered (danger)
0.00%
0 / 2
0.00% covered (danger)
0.00%
0 / 1
2
1<?php
2declare( strict_types = 1 );
3
4namespace MediaWiki\Extension\Translate\MessageGroupProcessing;
5
6/**
7 * Wrapper class for using message group states.
8 *
9 * @author Niklas Laxström
10 * @author Siebrand Mazeland
11 * @copyright Copyright © 2012-2013 Niklas Laxström
12 * @license GPL-2.0-or-later
13 */
14class MessageGroupStates {
15    private const CONDKEY = 'state conditions';
16
17    private ?array $config;
18
19    public function __construct( ?array $config = null ) {
20        $this->config = $config;
21    }
22
23    public function getStates(): ?array {
24        $conf = $this->config;
25        unset( $conf[self::CONDKEY] );
26
27        return $conf;
28    }
29
30    public function getConditions(): array {
31        $conf = $this->config;
32        return $conf[self::CONDKEY] ?? [];
33    }
34}
35
36class_alias( MessageGroupStates::class, 'MessageGroupStates' );