Completed
Push — master ( 6d1705...9d80f0 )
by Jeroen De
02:45
created

IdGeneratorFactory   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 13
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 13
ccs 4
cts 4
cp 1
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A getIdGenerator() 0 7 2
1
<?php
2
3
declare( strict_types = 1 );
4
5
namespace IdGenerator;
6
7
use IdGenerator\PackagePrivate\PagePropsIdGenerator;
8
use Wikimedia\Rdbms\ILoadBalancer;
9
10
class IdGeneratorFactory {
11
12
	private $generator;
13
14 1
	public function getIdGenerator( ILoadBalancer $loadBalancer ): IdGenerator {
15 1
		if ( $this->generator === null ) {
16 1
			$this->generator = new PagePropsIdGenerator( $loadBalancer );
17
		}
18
19 1
		return $this->generator;
20
	}
21
22
}
23