Completed
Pull Request — master (#1473)
by Tim
31:22 queued 01:19
created

BasicMailSubjectRenderer::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 3
CRAP Score 1

Importance

Changes 0
Metric Value
cc 1
eloc 2
nc 1
nop 2
dl 0
loc 3
ccs 3
cts 3
cp 1
crap 1
rs 10
c 0
b 0
f 0
1
<?php
2
3
declare( strict_types = 1 );
4
5
namespace WMDE\Fundraising\Frontend\Infrastructure\Mail;
6
7
use Symfony\Component\Translation\TranslatorInterface;
8
9
/**
10
 * @license GNU GPL v2+
11
 */
12
class BasicMailSubjectRenderer implements MailSubjectRendererInterface {
13
14
	private $translator;
15
	private $subjectKey;
16
17 21
	public function __construct( TranslatorInterface $translator, string $subjectKey ) {
18 21
		$this->translator = $translator;
19 21
		$this->subjectKey = $subjectKey;
20 21
	}
21
22 12
	public function render( array $templateArguments = [] ): string {
23 12
		return $this->translator->trans( $this->subjectKey );
24
	}
25
26
}
27