PropertyDataTypeLookupException   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 27
Duplicated Lines 0 %

Test Coverage

Coverage 0%

Importance

Changes 2
Bugs 0 Features 0
Metric Value
eloc 7
c 2
b 0
f 0
dl 0
loc 27
ccs 0
cts 9
cp 0
rs 10
wmc 3

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 7 2
A getPropertyId() 0 2 1
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