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

IdGeneratorFactory::getIdGenerator()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 7

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 4
CRAP Score 2

Importance

Changes 0
Metric Value
dl 0
loc 7
ccs 4
cts 4
cp 1
rs 10
c 0
b 0
f 0
cc 2
nc 2
nop 1
crap 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