DispatchingEntityIdForQueryLookup   A
last analyzed

Complexity

Total Complexity 4

Size/Duplication

Total Lines 39
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Test Coverage

Coverage 100%

Importance

Changes 3
Bugs 0 Features 1
Metric Value
wmc 4
c 3
b 0
f 1
lcom 1
cbo 1
dl 0
loc 39
ccs 9
cts 9
cp 1
rs 10

4 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 3 1
A getItemIdsForQuery() 0 3 1
A getPropertyIdsForQuery() 0 3 1
A getEntityIdsForQuery() 0 7 1
1
<?php
2
3
namespace Wikibase\EntityStore\Internal;
4
5
use Ask\Language\Description\Description;
6
use Ask\Language\Option\QueryOptions;
7
use Wikibase\DataModel\Entity\Item;
8
use Wikibase\DataModel\Entity\Property;
9
use Wikibase\EntityStore\ItemIdForQueryLookup;
10
use Wikibase\EntityStore\PropertyIdForQueryLookup;
11
12
/**
13
 * Internal class
14
 *
15
 * @licence GPLv2+
16
 * @author Thomas Pellissier Tanon
17
 */
18
class DispatchingEntityIdForQueryLookup implements ItemIdForQueryLookup, PropertyIdForQueryLookup, EntityIdForQueryLookup {
19
20
	/**
21
	 * @var EntityIdForQueryLookup
22
	 */
23
	private $entityIdForQueryLookup;
24
25
	/**
26
	 * @param EntityIdForQueryLookup $entityIdForQueryLookup
27
	 */
28 4
	public function __construct( EntityIdForQueryLookup $entityIdForQueryLookup ) {
29 4
		$this->entityIdForQueryLookup = $entityIdForQueryLookup;
30 4
	}
31
32
	/**
33
	 * @see EntityIdsForQueryLookup:getEntityDocumentsForQuery
34
	 */
35 1
	public function getEntityIdsForQuery(
36
		Description $queryDescription,
37
		QueryOptions $queryOptions = null,
38
		$entityType = null
39
	) {
40 1
		return $this->entityIdForQueryLookup->getEntityIdsForQuery( $queryDescription, $queryOptions, $entityType );
41
	}
42
43
	/**
44
	 * @see ItemIdsForQueryLookup::getItemForQuery
45
	 */
46 2
	public function getItemIdsForQuery( Description $queryDescription, QueryOptions $queryOptions = null ) {
47 2
		return $this->entityIdForQueryLookup->getEntityIdsForQuery( $queryDescription, $queryOptions, Item::ENTITY_TYPE );
48
	}
49
50
	/**
51
	 * @see PropertyIdsForQueryLookup::getPropertyForQuery
52
	 */
53 2
	public function getPropertyIdsForQuery( Description $queryDescription, QueryOptions $queryOptions = null ) {
54 2
		return $this->entityIdForQueryLookup->getEntityIdsForQuery( $queryDescription, $queryOptions, Property::ENTITY_TYPE );
55
	}
56
}
57