EmptyBannerSelectionData   A
last analyzed

Complexity

Total Complexity 5

Size/Duplication

Total Lines 21
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

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

5 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 3 1
A displayBanner() 0 2 1
A getVisitorData() 0 2 1
A getBannerIdentifier() 0 2 1
A getCampaignEnd() 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 EmptyBannerSelectionData implements BannerSelectionData {
13
14 3
	public function __construct(
15
		private readonly Visitor $visitorData
16
	) {
17 3
	}
18
19 1
	public function displayBanner(): bool {
20 1
		return false;
21
	}
22
23 1
	public function getVisitorData(): Visitor {
24 1
		return $this->visitorData;
25
	}
26
27 1
	public function getBannerIdentifier(): string {
28 1
		throw new \LogicException( 'Empty banner selection does not contain banner data.' );
29
	}
30
31 1
	public function getCampaignEnd(): \DateTime {
32 1
		throw new \LogicException( 'Empty banner selection does not contain campaign data.' );
33
	}
34
}
35