Completed
Push — master ( 8fd8d8...81863e )
by Tonina
877:57 queued 875:15
created

BannerSelection::getBannerIdentifier()   A

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 0
Metric Value
cc 1
eloc 1
nc 1
nop 0
dl 0
loc 2
ccs 0
cts 2
cp 0
crap 2
rs 10
c 0
b 0
f 0
1
<?php
2
3
declare( strict_types = 1 );
4
5
namespace WMDE\BannerServer\UseCase\BannerSelection;
6
7
/**
8
 * @license GNU GPL v2+
9
 */
10
class BannerSelection {
11
12
	private $bannerIdentifier;
13
	private $visitorData;
14
	private $campaignEnd;
15
16
	public function __construct( ?string $bannerIdentifier, Visitor $visitorData, \DateTime $campaignEnd ) {
17
		$this->bannerIdentifier = $bannerIdentifier;
18
		$this->visitorData = $visitorData;
19
		$this->campaignEnd = $campaignEnd;
20
	}
21
22
	public function displayBanner(): bool {
23
		return $this->bannerIdentifier !== null;
24
	}
25
26
	public function getBannerIdentifier(): ?string {
27
		return $this->bannerIdentifier;
28
	}
29
30
	public function getVisitorData(): Visitor {
31
		return $this->visitorData;
32
	}
33
34
	public function getCampaignEnd(): \DateTime {
35
		return $this->campaignEnd;
36
	}
37
}