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

Honorifics   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 26
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 0

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 3
lcom 1
cbo 0
dl 0
loc 26
ccs 7
cts 7
cp 1
rs 10
c 0
b 0
f 0

3 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 3 1
A getList() 0 3 1
A getKeys() 0 3 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
}