ItemLookupException::__construct()   A
last analyzed

Complexity

Conditions 2
Paths 1

Size

Total Lines 7

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 6
CRAP Score 2

Importance

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