ProophExtension   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 19
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 3

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 1
lcom 1
cbo 3
dl 0
loc 19
ccs 6
cts 6
cp 1
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A load() 0 10 1
1
<?php declare(strict_types = 1);
2
3
namespace TomCizek\SymfonyProoph\DependencyInjection;
4
5
use Symfony\Component\DependencyInjection\ContainerBuilder;
6
use Symfony\Component\DependencyInjection\Extension\Extension;
7
use TomCizek\SymfonyProoph\Common\ConfigArrayBuilder;
8
use TomCizek\SymfonyProoph\ProophExtensionConfigurator;
9
10
class ProophExtension extends Extension
11
{
12
	/** @var array */
13
	public $defaults = [];
14
15
	/** @var ConfigArrayBuilder */
16
	protected $configBuilder;
17
18 18
	public function load(array $configs, ContainerBuilder $containerBuilder): void
19
	{
20 18
		$this->configBuilder = ConfigArrayBuilder::fromConfigs($configs);
0 ignored issues
show
Documentation Bug introduced by
It seems like \TomCizek\SymfonyProoph\...::fromConfigs($configs) of type object<self> is incompatible with the declared type object<TomCizek\SymfonyP...mon\ConfigArrayBuilder> of property $configBuilder.

Our type inference engine has found an assignment to a property that is incompatible with the declared type of that property.

Either this assignment is in error or the assigned type should be added to the documentation/type hint for that property..

Loading history...
21
22 18
		$extensionConfigurator = new ProophExtensionConfigurator($containerBuilder);
23
24 18
		$this->configBuilder->mergeDefaultConfig($extensionConfigurator->buildDefaultConfig());
25
26 18
		$extensionConfigurator->configureWithConfig($this->configBuilder->build());
27 16
	}
28
}
29
30