ActiveBannerSelectionData   A
last analyzed

Complexity

Total Complexity 5

Size/Duplication

Total Lines 23
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 5
eloc 5
c 0
b 0
f 0
dl 0
loc 23
ccs 10
cts 10
cp 1
rs 10

5 Methods

Rating   Name   Duplication   Size   Complexity  
A getCampaignEnd() 0 2 1
A getBannerIdentifier() 0 2 1
A getVisitorData() 0 2 1
A __construct() 0 5 1
A displayBanner() 0 2 1
1
<?php
2
3
declare( strict_types = 1 );
4
5
namespace WMDE\BannerServer\UseCase\BannerSelection;
6
7
use WMDE\BannerServer\Entity\Visitor;
8
9
/**
10
 * @license GPL-2.0-or-later
11
 */
12
class ActiveBannerSelectionData implements BannerSelectionData {
13
14 1
	public function __construct(
15
		private readonly Visitor $visitorData,
16
		private readonly string $bannerIdentifier,
17
		private readonly \DateTime $campaignEnd
18
	) {
19 1
	}
20
21 1
	public function displayBanner(): bool {
22 1
		return true;
23
	}
24
25 1
	public function getVisitorData(): Visitor {
26 1
		return $this->visitorData;
27
	}
28
29 1
	public function getBannerIdentifier(): string {
30 1
		return $this->bannerIdentifier;
31
	}
32
33 1
	public function getCampaignEnd(): \DateTime {
34 1
		return $this->campaignEnd;
35
	}
36
}
37