LabelDescriptionLookupException   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 27
Duplicated Lines 0 %

Test Coverage

Coverage 0%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 7
c 1
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 getEntityId() 0 2 1
1
<?php
2
3
namespace Wikibase\DataModel\Services\Lookup;
4
5
use Exception;
6
use RuntimeException;
7
use Wikibase\DataModel\Entity\EntityId;
8
9
/**
10
 * @since 2.0
11
 *
12
 * @license GPL-2.0-or-later
13
 * @author Addshore
14
 */
15
class LabelDescriptionLookupException extends RuntimeException {
16
17
	/**
18
	 * @var EntityId
19
	 */
20
	private $entityId;
21
22
	/**
23
	 * @param EntityId $entityId
24
	 * @param string|null $message
25
	 * @param Exception|null $previous
26
	 */
27
	public function __construct( EntityId $entityId, $message = null, ?Exception $previous = null ) {
28
		$this->entityId = $entityId;
29
30
		parent::__construct(
31
			$message ?: 'Label and description lookup failed for: ' . $entityId,
32
			0,
33
			$previous
34
		);
35
	}
36
37
	/**
38
	 * @return EntityId
39
	 */
40
	public function getEntityId() {
41
		return $this->entityId;
42
	}
43
44
}
45