Completed
Pull Request — master (#608)
by Jeroen De
68:36 queued 64:37
created

Honorifics::getList()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 0
Metric Value
dl 0
loc 3
ccs 2
cts 2
cp 1
rs 10
c 0
b 0
f 0
cc 1
eloc 2
nc 1
nop 0
crap 1
1
<?php
2
3
declare( strict_types = 1 );
4
5
namespace WMDE\Fundraising\Frontend\ApplicationContext\Infrastructure;
6
7
/**
8
 * Encapsulates a list of honorifics for the current locale.
9
 *
10
 * @license GNU GPL v2+
11
 * @author Gabriel Birke < [email protected] >
12
 */
13
class Honorifics {
14
15
	private $honorifics;
16
17
	/**
18
	 * @param string[] $honorifics name => display name pairs
19
	 */
20 65
	public function __construct( array $honorifics ) {
21 65
		$this->honorifics = $honorifics;
22 65
	}
23
24
	/**
25
	 * @return string[]
26
	 */
27 59
	public function getList(): array {
28 59
		return $this->honorifics;
29
	}
30
31
	/**
32
	 * @return string[]
33
	 */
34 7
	public function getKeys(): array {
35 7
		return array_keys( $this->honorifics );
36
	}
37
38
}