Completed
Push — master ( 1a95a1...5ef349 )
by Kamil
04:55
created

CrossContainerExtension   A

Complexity

Total Complexity 7

Size/Duplication

Total Lines 69
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 2

Importance

Changes 0
Metric Value
wmc 7
lcom 1
cbo 2
dl 0
loc 69
rs 10
c 0
b 0
f 0

7 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A getCrossContainerProcessor() 0 4 1
A getConfigKey() 0 4 1
A initialize() 0 3 1
A configure() 0 3 1
A load() 0 4 1
A process() 0 3 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 FriendsOfBehat\CrossContainerExtension\CrossContainerProcessor;
19
use Symfony\Component\Config\Definition\Builder\ArrayNodeDefinition;
20
use Symfony\Component\DependencyInjection\ContainerBuilder;
21
22
/**
23
 * @api
24
 */
25
final class CrossContainerExtension implements Extension
26
{
27
    /**
28
     * @var CrossContainerProcessor
29
     */
30
    private $crossContainerProcessor;
31
32
    public function __construct()
33
    {
34
        $this->crossContainerProcessor = new CrossContainerProcessor();
35
    }
36
37
    /**
38
     * @api
39
     *
40
     * @return CrossContainerProcessor
41
     */
42
    public function getCrossContainerProcessor()
43
    {
44
        return $this->crossContainerProcessor;
45
    }
46
47
    /**
48
     * @internal
49
     *
50
     * {@inheritdoc}
51
     */
52
    public function getConfigKey()
53
    {
54
        return 'fob_cross_container';
55
    }
56
57
    /**
58
     * @internal
59
     *
60
     * {@inheritdoc}
61
     */
62
    public function initialize(ExtensionManager $extensionManager)
63
    {
64
    }
65
66
    /**
67
     * @internal
68
     *
69
     * {@inheritdoc}
70
     */
71
    public function configure(ArrayNodeDefinition $builder)
72
    {
73
    }
74
75
    /**
76
     * @internal
77
     *
78
     * {@inheritdoc}
79
     */
80
    public function load(ContainerBuilder $container, array $config)
81
    {
82
        $this->crossContainerProcessor->addContainerAccessor('behat', new ContainerBasedContainerAccessor($container));
83
    }
84
85
    /**
86
     * @internal
87
     *
88
     * {@inheritdoc}
89
     */
90
    public function process(ContainerBuilder $container)
91
    {
92
    }
93
}
94