PropertyApiLookup   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 23
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Test Coverage

Coverage 100%

Importance

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

2 Methods

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