EntityStoreFactory   A
last analyzed

Complexity

Total Complexity 5

Size/Duplication

Total Lines 30
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 5

Test Coverage

Coverage 42.86%

Importance

Changes 0
Metric Value
wmc 5
lcom 1
cbo 5
dl 0
loc 30
ccs 6
cts 14
cp 0.4286
rs 10
c 0
b 0
f 0

5 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A newEntityStore() 0 6 1
A newItemStore() 0 3 1
A newPropertyStore() 0 3 1
A newPropertyTypeLookup() 0 3 1
1
<?php
2
3
namespace Queryr\EntityStore;
4
5
use Doctrine\DBAL\Connection;
6
7
/**
8
 * @licence GNU GPL v2+
9
 * @author Jeroen De Dauw < [email protected] >
10
 */
11
class EntityStoreFactory {
12
13
	private $connection;
14
	private $config;
15
16 1
	public function __construct( Connection $connection, EntityStoreConfig $config ) {
17 1
		$this->connection = $connection;
18 1
		$this->config = $config;
19 1
	}
20
21
	public function newEntityStore() {
22
		return new EntityStore(
23
			$this->newItemStore(),
24
			$this->newPropertyStore()
25
		);
26
	}
27
28
	public function newItemStore() {
29
		return new ItemStore( $this->connection, $this->config->getItemTableName() );
30
	}
31
32
	public function newPropertyStore() {
33
		return new PropertyStore( $this->connection, $this->config->getPropertyTableName() );
34
	}
35
36 1
	public function newPropertyTypeLookup() {
37 1
		return new PropertyTypeLookup( $this->connection, $this->config->getPropertyTableName() );
38
	}
39
40
}