Completed
Push — master ( 659d4b...50002f )
by adam
06:20
created

ItemApiLookup::getItemForId()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 3
CRAP Score 1.0156

Importance

Changes 3
Bugs 0 Features 1
Metric Value
c 3
b 0
f 1
dl 0
loc 5
ccs 3
cts 4
cp 0.75
rs 9.4286
cc 1
eloc 3
nc 1
nop 1
crap 1.0156
1
<?php
2
3
namespace Wikibase\Api\Lookup;
4
5
use Wikibase\DataModel\Entity\ItemId;
6
use Wikibase\DataModel\Services\Lookup\EntityLookup;
7
use Wikibase\DataModel\Services\Lookup\ItemLookup;
8
9
/**
10
 * @access private
11
 *
12
 * @author Thomas Pellissier Tanon
13
 * @author Addshore
14
 */
15
class ItemApiLookup implements ItemLookup {
16
17
	/**
18
	 * @var EntityLookup
19
	 */
20
	private $entityLookup;
21
22
	/**
23
	 * @param EntityLookup $entityLookup
24
	 */
25 2
	public function __construct( EntityLookup $entityLookup ) {
26 2
		$this->entityLookup = $entityLookup;
27
	}
28
29
	/**
30
	 * @see ItemLookup::getItemForId
31
	 */
32 2
	public function getItemForId( ItemId $itemId ) {
33
		$entity = $this->entityLookup->getEntity( $itemId );
34
35 2
		return $entity;
36 2
	}
37
}
38