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

getCrossContainerProcessor()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 4
rs 10
c 0
b 0
f 0
cc 1
eloc 2
nc 1
nop 0
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