PantherExtension   A
last analyzed

Complexity

Total Complexity 6

Size/Duplication

Total Lines 44
Duplicated Lines 0 %

Test Coverage

Coverage 0%

Importance

Changes 0
Metric Value
wmc 6
eloc 6
dl 0
loc 44
ccs 0
cts 20
cp 0
rs 10
c 0
b 0
f 0

5 Methods

Rating   Name   Duplication   Size   Complexity  
A getConfigKey() 0 3 1
A load() 0 2 1
A configure() 0 2 1
A initialize() 0 10 2
A process() 0 2 1
1
<?php
2
declare(strict_types=1);
3
4
namespace Robertfausk\Behat\PantherExtension\ServiceContainer;
5
6
use Behat\MinkExtension\ServiceContainer\MinkExtension;
7
use Behat\Testwork\ServiceContainer\Extension as ExtensionInterface;
8
use Behat\Testwork\ServiceContainer\ExtensionManager;
9
use Robertfausk\Behat\PantherExtension\ServiceContainer\Driver\PantherFactory;
10
use Symfony\Component\Config\Definition\Builder\ArrayNodeDefinition;
11
use Symfony\Component\DependencyInjection\ContainerBuilder;
12
13
/**
14
 * @author Robert Freigang <[email protected]>
15
 */
16
final class PantherExtension implements ExtensionInterface
17
{
18
    /**
19
     * @inheritdoc
20
     */
21
    public function process(ContainerBuilder $container): void
22
    {
23
    }
24
25
    /**
26
     * @inheritdoc
27
     */
28
    public function getConfigKey(): string
29
    {
30
        return 'panther';
31
    }
32
33
    /**
34
     * @inheritdoc
35
     */
36
    public function initialize(ExtensionManager $extensionManager): void
37
    {
38
        /** @var MinkExtension|null $minkExtension */
39
        $minkExtension = $extensionManager->getExtension('mink');
40
41
        if ($minkExtension === null) {
42
            return;
43
        }
44
45
        $minkExtension->registerDriverFactory(new PantherFactory());
46
    }
47
48
    /**
49
     * @inheritdoc
50
     */
51
    public function configure(ArrayNodeDefinition $builder): void
52
    {
53
    }
54
55
    /**
56
     * @inheritdoc
57
     */
58
    public function load(ContainerBuilder $container, array $config): void
59
    {
60
    }
61
}
62