QuantityQuery   A
last analyzed

Complexity

Total Complexity 5

Size/Duplication

Total Lines 56
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Test Coverage

Coverage 100%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 5
c 1
b 0
f 0
lcom 0
cbo 1
dl 0
loc 56
ccs 13
cts 13
cp 1
rs 10

5 Methods

Rating   Name   Duplication   Size   Complexity  
A getPropertyId() 0 3 1
A getLowerValue() 0 3 1
A getUpperValue() 0 3 1
A getType() 0 3 1
A __construct() 0 5 1
1
<?php
2
3
namespace WikidataQueryApi\Query;
4
5
use DataValues\DecimalValue;
6
use Wikibase\DataModel\Entity\PropertyId;
7
8
/**
9
 * @licence GPLv2+
10
 * @author Thomas Pellissier Tanon
11
 */
12
class QuantityQuery extends AbstractQuery {
13
14
	/**
15
	 * @var PropertyId
16
	 */
17
	private $propertyId;
18
19
	/**
20
	 * @var DecimalValue
21
	 */
22
	private $lowerValue;
23
24
	/**
25
	 * @var DecimalValue|null
26
	 */
27
	private $upperValue;
28
29
	/**
30
	 * @param PropertyId $propertyId
31
	 * @param DecimalValue $lowerValue
32
	 * @param DecimalValue|null $upperValue
33
	 */
34 4
	public function __construct( PropertyId $propertyId, DecimalValue $lowerValue, DecimalValue $upperValue = null ) {
35 4
		$this->propertyId = $propertyId;
36 4
		$this->lowerValue = $lowerValue;
37 4
		$this->upperValue = $upperValue;
38 4
	}
39
40
	/**
41
	 * @return PropertyId
42
	 */
43 1
	public function getPropertyId() {
44 1
		return $this->propertyId;
45
	}
46
47
	/**
48
	 * @return DecimalValue
49
	 */
50 1
	public function getLowerValue() {
51 1
		return $this->lowerValue;
52
	}
53
54
	/**
55
	 * @return DecimalValue|null
56
	 */
57 1
	public function getUpperValue() {
58 1
		return $this->upperValue;
59
	}
60
61
	/**
62
	 * @see AbstractQuery::getType
63
	 */
64 1
	public function getType() {
65 1
		return 'quantity';
66
	}
67
}
68