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

BasicMailSubjectRenderer   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 12
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
eloc 6
dl 0
loc 12
ccs 6
cts 6
cp 1
rs 10
c 0
b 0
f 0
wmc 2

2 Methods

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