Completed
Push — master ( 9ce12b...110b75 )
by adam
02:38
created

PropertyApiLookup::getPropertyForId()   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 0
Metric Value
dl 0
loc 5
ccs 3
cts 4
cp 0.75
rs 9.4285
c 0
b 0
f 0
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\PropertyId;
6
use Wikibase\DataModel\Services\Lookup\EntityLookup;
7
use Wikibase\DataModel\Services\Lookup\PropertyLookup;
8
9
/**
10
 * @access private
11
 *
12
 * @author Thomas Pellissier Tanon
13
 * @author Addshore
14
 */
15
class PropertyApiLookup implements PropertyLookup {
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::getPropertyForId
31
	 */
32 2
	public function getPropertyForId( PropertyId $propertyId ) {
33
		$entity = $this->entityLookup->getEntity( $propertyId );
34
35 2
		return $entity;
36 2
	}
37
}
38