PropertyDataTypeLookupException::__construct()   A
last analyzed

Complexity

Conditions 2
Paths 1

Size

Total Lines 9

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 6

Importance

Changes 0
Metric Value
dl 0
loc 9
ccs 0
cts 7
cp 0
rs 9.9666
c 0
b 0
f 0
cc 2
nc 1
nop 3
crap 6
1
<?php
2
3
namespace Wikibase\DataModel\Services\Lookup;
4
5
use Exception;
6
use RuntimeException;
7
use Wikibase\DataModel\Entity\PropertyId;
8
9
/**
10
 * @since 2.0
11
 *
12
 * @license GPL-2.0-or-later
13
 * @author Addshore
14
 */
15
class PropertyDataTypeLookupException extends RuntimeException {
16
17
	/**
18
	 * @var PropertyId
19
	 */
20
	private $propertyId;
21
22
	/**
23
	 * @param PropertyId $propertyId
24
	 * @param string|null $message
25
	 * @param Exception|null $previous
26
	 */
27
	public function __construct( PropertyId $propertyId, $message = null, Exception $previous = null ) {
28
		$this->propertyId = $propertyId;
29
30
		parent::__construct(
31
			$message ?: 'Property data type lookup failed for: ' . $propertyId,
32
			0,
33
			$previous
34
		);
35
	}
36
37
	/**
38
	 * @return PropertyId
39
	 */
40
	public function getPropertyId() {
41
		return $this->propertyId;
42
	}
43
44
}
45