Completed
Push — master ( 2623ee...a82f7c )
by Jeroen De
06:13 queued 04:44
created

ResultFormat::getName()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3

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
nc 1
nop 0
crap 1
1
<?php
2
3
declare( strict_types = 1 );
4
5
namespace ModernTimeline\ResultFacade;
6
7
class ResultFormat {
8
9
	private $name;
10
	private $nameMessageKey;
11
	private $parameterDefinitions;
12
	private $constructionFunction;
13
14 5
	public function __construct( string $name, string $nameMessageKey, array $parameterDefinitions, callable $presenterBuilder ) {
15 5
		$this->name = $name;
16 5
		$this->nameMessageKey = $nameMessageKey;
17 5
		$this->parameterDefinitions = $parameterDefinitions;
18 5
		$this->constructionFunction = $presenterBuilder;
19 5
	}
20
21 5
	public function getName(): string {
22 5
		return $this->name;
23
	}
24
25
	public function getNameMessageKey(): string {
26
		return $this->nameMessageKey;
27
	}
28
29 5
	public function getParameterDefinitions(): array {
30 5
		return $this->parameterDefinitions;
31
	}
32
33 4
	public function buildPresenter(): ResultPresenter {
34 4
		return call_user_func( $this->constructionFunction );
35
	}
36
37
}
38