ChooseTestsExtension   A
last analyzed

Complexity

Total Complexity 5

Size/Duplication

Total Lines 46
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 4

Importance

Changes 0
Metric Value
wmc 5
lcom 0
cbo 4
dl 0
loc 46
rs 10
c 0
b 0
f 0

5 Methods

Rating   Name   Duplication   Size   Complexity  
A getConfigKey() 0 4 1
A process() 0 4 1
A initialize() 0 4 1
A configure() 0 4 1
A load() 0 7 1
1
<?php
2
3
namespace Bex\Behat\ChooseTestsExtension\ServiceContainer;
4
5
use Behat\Testwork\ServiceContainer\Extension;
6
use Behat\Testwork\ServiceContainer\ExtensionManager;
7
use Symfony\Component\Config\Definition\Builder\ArrayNodeDefinition;
8
use Symfony\Component\Config\FileLocator;
9
use Symfony\Component\DependencyInjection\ContainerBuilder;
10
use Symfony\Component\DependencyInjection\Loader\XmlFileLoader;
11
12
/**
13
 * This class is the entry point of the extension
14
 *
15
 * @license http://opensource.org/licenses/MIT The MIT License
16
 */
17
class ChooseTestsExtension implements Extension
18
{
19
    const CONFIG_KEY = 'choosetests';
20
21
     /**
22
     * {@inheritdoc}
23
     */
24
    public function getConfigKey()
25
    {
26
        return self::CONFIG_KEY;
27
    }
28
    /**
29
     * {@inheritdoc}
30
     */
31
    public function process(ContainerBuilder $container)
32
    {
33
        // nothing to do here
34
    }
35
36
    /**
37
     * {@inheritdoc}
38
     */
39
    public function initialize(ExtensionManager $extensionManager)
40
    {
41
        // nothing to do here
42
    }
43
44
    /**
45
     * {@inheritdoc}
46
     */
47
    public function configure(ArrayNodeDefinition $builder)
48
    {
49
        // ...
50
    }
51
52
    /**
53
     * {@inheritdoc}
54
     */
55
    public function load(ContainerBuilder $container, array $config)
56
    {
57
        $loader = new XmlFileLoader($container, new FileLocator(__DIR__ . '/config'));
58
        $loader->load('services.xml');
59
        $extensionConfig = new Config($config);
60
        $container->set('bex.choose_tests_extension.config', $extensionConfig);
61
    }
62
}
63