SQLStoreWithDependencies   A
last analyzed

Complexity

Total Complexity 7

Size/Duplication

Total Lines 41
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 2

Importance

Changes 0
Metric Value
wmc 7
lcom 1
cbo 2
dl 0
loc 41
rs 10
c 0
b 0
f 0

7 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 8 1
A newQueryEngine() 0 3 1
A newWriter() 0 3 1
A newInstaller() 0 3 1
A newUninstaller() 0 3 1
A newUpdater() 0 3 1
A __destruct() 0 3 1
1
<?php
2
3
namespace Wikibase\QueryEngine\SQLStore;
4
5
use Doctrine\DBAL\Connection;
6
use Wikibase\DataModel\Entity\EntityIdParser;
7
use Wikibase\QueryEngine\PropertyDataValueTypeLookup;
8
use Wikibase\QueryEngine\QueryStoreWithDependencies;
9
10
class SQLStoreWithDependencies implements QueryStoreWithDependencies {
11
12
	private $factory;
13
	private $connection;
14
	private $lookup;
15
	private $idParser;
16
17
	public function __construct( SQLStore $factory, Connection $connection,
18
		PropertyDataValueTypeLookup $lookup, EntityIdParser $idParser ) {
19
20
		$this->factory = $factory;
21
		$this->connection = $connection;
22
		$this->lookup = $lookup;
23
		$this->idParser = $idParser;
24
	}
25
26
	public function newQueryEngine() {
27
		return $this->factory->newQueryEngine( $this->connection, $this->lookup, $this->idParser );
28
	}
29
30
	public function newWriter() {
31
		return $this->factory->newWriter( $this->connection );
32
	}
33
34
	public function newInstaller() {
35
		return $this->factory->newInstaller( $this->connection->getSchemaManager() );
36
	}
37
38
	public function newUninstaller() {
39
		return $this->factory->newUninstaller( $this->connection->getSchemaManager() );
40
	}
41
42
	public function newUpdater() {
43
		return $this->factory->newUpdater( $this->connection->getSchemaManager() );
44
	}
45
46
	public function __destruct() {
47
		$this->connection->close();
48
	}
49
50
}
51