Completed
Push — master ( 3ad6ad...1b8708 )
by adam
23:03 queued 15:31
created

ItemApiLookup   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 23
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Test Coverage

Coverage 100%

Importance

Changes 3
Bugs 0 Features 1
Metric Value
wmc 2
c 3
b 0
f 1
lcom 1
cbo 1
dl 0
loc 23
ccs 6
cts 6
cp 1
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 3 1
A getItemForId() 0 5 1
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 2
	}
28
29
	/**
30
	 * @see ItemLookup::getItemForId
31
	 */
32 2
	public function getItemForId( ItemId $itemId ) {
33 2
		$entity = $this->entityLookup->getEntity( $itemId );
34
35 2
		return $entity;
36
	}
37
}
38