ResultFormat::getNameMessageKey()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 2
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 1
c 1
b 0
f 0
nc 1
nop 0
dl 0
loc 2
ccs 0
cts 0
cp 0
crap 2
rs 10
1
<?php
2
3
declare( strict_types = 1 );
4
5
namespace ModernTimeline\ResultFacade;
6
7
class ResultFormat {
8
9
	/**
10
	 * @var callable
11
	 */
12
	private $constructionFunction;
13
14 5
	public function __construct(
15 5
		private string $name,
16 5
		private string $nameMessageKey,
17 5
		private array $parameterDefinitions,
18 5
		callable $presenterBuilder
19 5
	) {
20
		$this->constructionFunction = $presenterBuilder;
21 5
	}
22 5
23
	public function getName(): string {
24
		return $this->name;
25
	}
26
27
	public function getNameMessageKey(): string {
28
		return $this->nameMessageKey;
29 5
	}
30 5
31
	public function getParameterDefinitions(): array {
32
		return $this->parameterDefinitions;
33 4
	}
34 4
35
	public function buildPresenter(): ResultPresenter {
36
		return call_user_func( $this->constructionFunction );
37
	}
38
39
}
40