EmptyBannerSelectionData::getBannerIdentifier()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 2
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 0
Metric Value
cc 1
eloc 1
nc 1
nop 0
dl 0
loc 2
ccs 2
cts 2
cp 1
crap 1
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
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