Completed
Push — master ( 31d688...478159 )
by adam
04:05 queued 01:35
created

ItemApiLookup::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1.037

Importance

Changes 2
Bugs 0 Features 1
Metric Value
c 2
b 0
f 1
dl 0
loc 3
ccs 2
cts 3
cp 0.6667
rs 10
cc 1
eloc 2
nc 1
nop 1
crap 1.037
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