ConfigurationResolverFactory   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 20
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 8
dl 0
loc 20
rs 10
c 0
b 0
f 0
wmc 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A create() 0 4 1
A __construct() 0 3 1
1
<?php
2
3
/*
4
 * This file is part of the OneGuard DynamicConfigurationBundle.
5
 *
6
 * (c) OneGuard <[email protected]>
7
 *
8
 * For the full copyright and license information, please view the LICENSE
9
 * file that was distributed with this source code.
10
 */
11
12
namespace OneGuard\Bundle\DynamicConfigurationBundle;
13
14
use Symfony\Bridge\Doctrine\RegistryInterface;
15
16
class ConfigurationResolverFactory {
17
	/**
18
	 * @var RegistryInterface
19
	 */
20
	private $doctrine;
21
22
	/**
23
	 * @var DefinitionRegistry
24
	 */
25
	private $registry;
26
27
	public function __construct(RegistryInterface $doctrine, DefinitionRegistry $registry) {
28
		$this->doctrine = $doctrine;
29
		$this->registry = $registry;
30
	}
31
32
	public function create(string $key) {
33
		return new ConfigurationResolver(
34
			$this->doctrine,
35
			$this->registry->get($key)
36
		);
37
	}
38
}
39