Completed
Push — master ( da5294...d5aa74 )
by Kamil
09:29
created

CrossContainerExtension   A

Complexity

Total Complexity 6

Size/Duplication

Total Lines 66
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Importance

Changes 0
Metric Value
wmc 6
lcom 1
cbo 1
dl 0
loc 66
rs 10
c 0
b 0
f 0

6 Methods

Rating   Name   Duplication   Size   Complexity  
A addContainer() 0 4 1
A getConfigKey() 0 4 1
A initialize() 0 4 1
A configure() 0 4 1
A load() 0 4 1
A process() 0 4 1
1
<?php
2
3
/*
4
 * This file is part of the CrossContainerExtension package.
5
 *
6
 * (c) Kamil Kokot <[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 FriendsOfBehat\CrossContainerExtension\ServiceContainer;
13
14
use Behat\Testwork\ServiceContainer\Extension;
15
use Behat\Testwork\ServiceContainer\ExtensionManager;
16
use FriendsOfBehat\CrossContainerExtension\ContainerAccessor;
17
use FriendsOfBehat\CrossContainerExtension\ContainerBasedContainerAccessor;
18
use Symfony\Component\Config\Definition\Builder\ArrayNodeDefinition;
19
use Symfony\Component\DependencyInjection\ContainerBuilder;
20
21
final class CrossContainerExtension implements Extension
22
{
23
    /**
24
     * @var ContainerAccessor[]
25
     */
26
    private $containers = [];
27
28
    /**
29
     * @param string $containerIdentifier
30
     * @param ContainerAccessor $containerAccessor
31
     */
32
    public function addContainer($containerIdentifier, ContainerAccessor $containerAccessor)
33
    {
34
        $this->containers[$containerIdentifier] = $containerAccessor;
35
    }
36
37
    /**
38
     * @internal
39
     *
40
     * {@inheritdoc}
41
     */
42
    public function getConfigKey()
43
    {
44
        return 'fob_cross_container';
45
    }
46
47
    /**
48
     * @internal
49
     *
50
     * {@inheritdoc}
51
     */
52
    public function initialize(ExtensionManager $extensionManager)
53
    {
54
55
    }
56
57
    /**
58
     * @internal
59
     *
60
     * {@inheritdoc}
61
     */
62
    public function configure(ArrayNodeDefinition $builder)
63
    {
64
65
    }
66
67
    /**
68
     * @internal
69
     *
70
     * {@inheritdoc}
71
     */
72
    public function load(ContainerBuilder $container, array $config)
73
    {
74
        $this->containers['behat'] = new ContainerBasedContainerAccessor($container);
75
    }
76
77
    /**
78
     * @internal
79
     *
80
     * {@inheritdoc}
81
     */
82
    public function process(ContainerBuilder $container)
83
    {
84
85
    }
86
}
87