Completed
Pull Request — master (#16)
by Thomas
06:38
created

InMemoryEntityStore::getEntityLookup()   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

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 3
ccs 2
cts 2
cp 1
rs 10
cc 1
eloc 2
nc 1
nop 0
crap 1
1
<?php
2
3
namespace Wikibase\EntityStore\InMemory;
4
5
use Wikibase\DataModel\Entity\EntityDocument;
6
use Wikibase\EntityStore\EntityStore;
7
use Wikibase\EntityStore\Internal\DispatchingEntityLookup;
8
9
/**
10
 * @licence GPLv2+
11
 * @author Thomas Pellissier Tanon
12
 */
13
class InMemoryEntityStore extends EntityStore {
14
15
	/**
16
	 * @var DispatchingEntityLookup
17
	 */
18
	private $entityLookup;
19
20
	/**
21
	 * @param EntityDocument[] $entities
22
	 */
23 4
	public function __construct( array $entities ) {
24 4
		parent::__construct();
25
26 4
		$this->entityLookup = new DispatchingEntityLookup( new InMemoryEntityLookup( $entities ) );
27 4
	}
28
29
	/**
30
	 * @see EntityStore::getEntityLookup
31
	 */
32 1
	public function getEntityLookup() {
33 1
		return $this->entityLookup;
34
	}
35
36
	/**
37
	 * @see EntityStore::getEntityDocumentLookup
38
	 */
39 1
	public function getEntityDocumentLookup() {
40 1
		return $this->entityLookup;
41
	}
42
43
	/**
44
	 * @see EntityStore::getItemLookup
45
	 */
46 1
	public function getItemLookup() {
47 1
		return $this->entityLookup;
48
	}
49
50
	/**
51
	 * @see EntityStore::getPropertyLookup
52
	 */
53 1
	public function getPropertyLookup() {
54 1
		return $this->entityLookup;
55
	}
56
}
57