BetweenQuery::__construct()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 5
CRAP Score 1

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 4
c 1
b 0
f 0
nc 1
nop 3
dl 0
loc 5
ccs 5
cts 5
cp 1
crap 1
rs 9.4285
1
<?php
2
3
namespace WikidataQueryApi\Query;
4
5
use DataValues\TimeValue;
6
use Wikibase\DataModel\Entity\PropertyId;
7
8
/**
9
 * @licence GPLv2+
10
 * @author Thomas Pellissier Tanon
11
 */
12
class BetweenQuery extends AbstractQuery {
13
14
	/**
15
	 * @var PropertyId
16
	 */
17
	private $propertyId;
18
19
	/**
20
	 * @var TimeValue|null
21
	 */
22
	private $beginValue;
23
24
	/**
25
	 * @var TimeValue|null
26
	 */
27
	private $endValue;
28
29
	/**
30
	 * @param PropertyId $propertyId
31
	 * @param TimeValue|null $beginValue
32
	 * @param TimeValue|null $endValue
33
	 */
34 4
	public function __construct( PropertyId $propertyId, TimeValue $beginValue = null, TimeValue $endValue = null ) {
35 4
		$this->propertyId = $propertyId;
36 4
		$this->beginValue = $beginValue;
37 4
		$this->endValue = $endValue;
38 4
	}
39
40
	/**
41
	 * @return PropertyId
42
	 */
43 1
	public function getPropertyId() {
44 1
		return $this->propertyId;
45
	}
46
47
	/**
48
	 * @return TimeValue|null
49
	 */
50 1
	public function getBeginValue() {
51 1
		return $this->beginValue;
52
	}
53
54
	/**
55
	 * @return TimeValue|null
56
	 */
57 1
	public function getEndValue() {
58 1
		return $this->endValue;
59
	}
60
61
	/**
62
	 * @see AbstractQuery::getType
63
	 */
64 1
	public function getType() {
65 1
		return 'between';
66
	}
67
}
68