TestExtension::process()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 5
rs 9.4285
c 0
b 0
f 0
cc 1
eloc 2
nc 1
nop 1
1
<?php declare(strict_types = 1);
2
3
namespace TomCizek\SymfonyInteropContainer\Tests\TestBundle\DependencyInjection;
4
5
use Symfony\Component\DependencyInjection\ContainerBuilder;
6
use TomCizek\SymfonyInteropContainer\AbstractInteropExtension;
7
8
class TestExtension extends AbstractInteropExtension
9
{
10
	public function load(array $configs, ContainerBuilder $containerBuilder)
11
	{
12
		// parent call is mandatory, or it will not work as expected!
13
		parent::load($configs, $containerBuilder);
14
15
		// we can set another config key (default is extension alias: $this->getAlias())
16
		$this->configBuilder->setKey('test');
17
18
		// we can merge over another config
19
		$this->configBuilder->mergeOverByConfig([]);
20
21
		// we can merge over multiple configs
22
		$this->configBuilder->mergeOverByConfigs([[]]);
23
24
		// we can merge default config
25
		$this->configBuilder->mergeDefaultConfig([]);
26
27
		// if you want, you can build config by:
28
		$config = $this->configBuilder->build();
29
30
		// it will be built in process method and injected into interop_container service
31
	}
32
33
	public function process(ContainerBuilder $containerBuilder)
34
	{
35
		// If you need to redefine process method, parent call is mandatory.
36
		parent::process($containerBuilder);
37
	}
38
}
39