Test Setup Failed
Pull Request — master (#19)
by Tim
60:53
created

EmptyBannerSelectionData   A

Complexity

Total Complexity 5

Size/Duplication

Total Lines 22
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 7
dl 0
loc 22
rs 10
c 0
b 0
f 0
wmc 5

5 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 2 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
/**
8
 * @license GNU GPL v2+
9
 */
10
class EmptyBannerSelectionData implements BannerSelectionData {
11
12
	private $visitorData;
13
14
	public function __construct( Visitor $visitorData ) {
15
		$this->visitorData = $visitorData;
16
	}
17
18
	public function displayBanner(): bool {
19
		return false;
20
	}
21
22
	public function getVisitorData(): Visitor {
23
		return $this->visitorData;
24
	}
25
26
	public function getBannerIdentifier(): string {
27
		throw new \LogicException( 'Empty banner selection does not contain banner data.' );
28
	}
29
30
	public function getCampaignEnd(): \DateTime {
31
		throw new \LogicException( 'Empty banner selection does not contain campaign data.' );
32
	}
33
}