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

IdGeneratorFactory::newIdGenerator()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

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