Completed
Push — master ( 36e04f...8ec39e )
by Jeroen De
04:55 queued 03:58
created

Event::getImageUrl()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
dl 0
loc 3
ccs 0
cts 2
cp 0
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 0
crap 2
1
<?php
2
3
declare( strict_types = 1 );
4
5
namespace ModernTimeline;
6
7
use ModernTimeline\ResultFacade\Subject;
8
use SMWDITime;
9
10
class Event {
11
12
	private $subject;
13
	private $startDate;
14
	private $endDate;
15
	private $imageUrl;
16
17 2
	public function __construct( Subject $subject, SMWDITime $startDate, ?SMWDITime $endDate ) {
18 2
		$this->subject = $subject;
19 2
		$this->startDate = $startDate;
20 2
		$this->endDate = $endDate;
21 2
	}
22
23 2
	public function getSubject(): Subject {
24 2
		return $this->subject;
25
	}
26
27 2
	public function getStartDate(): SMWDITime {
28 2
		return $this->startDate;
29
	}
30
31 2
	public function getEndDate(): ?SMWDITime {
32 2
		return $this->endDate;
33
	}
34
35 2
	public function hasImage(): bool {
36 2
		return $this->imageUrl !== null;
37
	}
38
39
	public function getImageUrl(): string {
40
		return $this->imageUrl;
41
	}
42
43
	public function setImageUrl( string $url ) {
44
		$this->imageUrl = $url;
45
	}
46
47
}
48