Passed
Pull Request — master (#2019)
by Gabriel
64:37
created

MembershipApplicationFormPresenter   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 15
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 10
c 1
b 0
f 0
dl 0
loc 15
rs 10
wmc 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 3 1
A present() 0 6 1
1
<?php
2
3
declare( strict_types = 1 );
4
5
namespace WMDE\Fundraising\Frontend\Presentation\Presenters;
6
7
use WMDE\Fundraising\Frontend\Presentation\TwigTemplate;
8
9
class MembershipApplicationFormPresenter {
10
	private TwigTemplate $template;
11
	private array $incentives;
12
13
	public function __construct( TwigTemplate $template, array $incentives ) {
14
		$this->template = $template;
15
		$this->incentives = $incentives;
16
	}
17
18
	public function present( array $urls, bool $showMembershipTypeOption, array $initialDonationFormValues, array $initialValidationResult ): string {
19
		return $this->template->render( [
20
			'urls' => $urls,
21
			'showMembershipTypeOption' => $showMembershipTypeOption,
22
			'initialFormValues' => array_merge( $initialDonationFormValues, [ 'incentives' => $this->incentives ] ),
23
			'initialValidationResult' => $initialValidationResult
24
		] );
25
	}
26
}
27