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

BasicMailSubjectRenderer::render()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 2
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 0
Metric Value
cc 1
eloc 1
nc 1
nop 1
dl 0
loc 2
ccs 2
cts 2
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