ProophExtension::load()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 10
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 6
CRAP Score 1

Importance

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