Completed
Push — develop ( e4e826...d92786 )
by ANTHONIUS
11s queued 10s
created

src/Extension.php (1 issue)

1
<?php
2
3
/*
4
 * This file is part of the DoyoUserBundle project.
5
 *
6
 * (c) Anthonius Munthi <[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
declare(strict_types=1);
13
14
namespace Doyo\Behat\Coverage;
15
16
use Behat\Testwork\ServiceContainer\Extension as ExtensionInterface;
17
use Behat\Testwork\ServiceContainer\ExtensionManager;
18
use Doyo\Behat\Coverage\Compiler\DriverPass;
19
use Symfony\Component\Config\Definition\Builder\ArrayNodeDefinition;
20
use Symfony\Component\Config\FileLocator;
21
use Symfony\Component\DependencyInjection\ContainerBuilder;
22
use Symfony\Component\DependencyInjection\Loader\XmlFileLoader;
23
24
class Extension implements ExtensionInterface
25
{
26
    public function process(ContainerBuilder $container)
27
    {
28
    }
29
30 1
    public function getConfigKey()
31
    {
32 1
        return 'doyo';
33
    }
34
35
    public function initialize(ExtensionManager $extensionManager)
36
    {
37
    }
38
39 1
    public function configure(ArrayNodeDefinition $builder)
40
    {
41 1
        $config = new Configuration();
42 1
        $config->configure($builder);
43
44 1
        return $builder;
45
    }
46
47 1
    public function load(ContainerBuilder $container, array $config)
48
    {
49 1
        $this->loadServices($container, $config);
50
51 1
        $container->setParameter('doyo.coverage.options', $config['coverage']);
52
    }
53
54 1
    private function loadServices(ContainerBuilder $container, array $config)
0 ignored issues
show
The parameter $config is not used and could be removed. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-unused  annotation

54
    private function loadServices(ContainerBuilder $container, /** @scrutinizer ignore-unused */ array $config)

This check looks for parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
55
    {
56 1
        $locator = new FileLocator(__DIR__.'/Resources/config');
57 1
        $loader  = new XmlFileLoader($container, $locator);
58
59 1
        $loader->load('core.xml');
60 1
        $loader->load('drivers.xml');
61 1
        $loader->load('coverage.xml');
62
63 1
        $container->addCompilerPass(new DriverPass());
64
    }
65
}
66