CrossContainerExtension::process()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 3
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 1
1
<?php
2
3
declare(strict_types=1);
4
5
/*
6
 * This file is part of the CrossContainerExtension package.
7
 *
8
 * (c) Kamil Kokot <[email protected]>
9
 *
10
 * For the full copyright and license information, please view the LICENSE
11
 * file that was distributed with this source code.
12
 */
13
14
namespace FriendsOfBehat\CrossContainerExtension\ServiceContainer;
15
16
use Behat\Testwork\ServiceContainer\Extension;
17
use Behat\Testwork\ServiceContainer\ExtensionManager;
18
use FriendsOfBehat\CrossContainerExtension\ContainerBasedContainerAccessor;
19
use FriendsOfBehat\CrossContainerExtension\CrossContainerProcessor;
20
use Symfony\Component\Config\Definition\Builder\ArrayNodeDefinition;
21
use Symfony\Component\DependencyInjection\ContainerBuilder;
22
23
/**
24
 * @api
25
 */
26
final class CrossContainerExtension implements Extension
27
{
28
    /**
29
     * @var CrossContainerProcessor
30
     */
31
    private $crossContainerProcessor;
32
33
    public function __construct()
34
    {
35
        $this->crossContainerProcessor = new CrossContainerProcessor();
36
    }
37
38
    /**
39
     * @api
40
     *
41
     * @return CrossContainerProcessor
42
     */
43
    public function getCrossContainerProcessor(): CrossContainerProcessor
44
    {
45
        return $this->crossContainerProcessor;
46
    }
47
48
    /**
49
     * @internal
50
     *
51
     * {@inheritdoc}
52
     */
53
    public function getConfigKey(): string
54
    {
55
        return 'fob_cross_container';
56
    }
57
58
    /**
59
     * @internal
60
     *
61
     * {@inheritdoc}
62
     */
63
    public function initialize(ExtensionManager $extensionManager): void
64
    {
65
    }
66
67
    /**
68
     * @internal
69
     *
70
     * {@inheritdoc}
71
     */
72
    public function configure(ArrayNodeDefinition $builder): void
73
    {
74
    }
75
76
    /**
77
     * @internal
78
     *
79
     * {@inheritdoc}
80
     */
81
    public function load(ContainerBuilder $container, array $config): void
82
    {
83
        $this->crossContainerProcessor->addContainerAccessor('behat', new ContainerBasedContainerAccessor($container));
84
    }
85
86
    /**
87
     * @internal
88
     *
89
     * {@inheritdoc}
90
     */
91
    public function process(ContainerBuilder $container): void
92
    {
93
    }
94
}
95