Passed
Pull Request — master (#15)
by ANTHONIUS
07:35
created

CodeCoverageExtension   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 19
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
eloc 9
dl 0
loc 19
ccs 11
cts 11
cp 1
rs 10
c 0
b 0
f 0
wmc 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A load() 0 12 1
A getAlias() 0 3 1
1
<?php
2
3
/*
4
 * This file is part of the doyo/code-coverage 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\Bridge\CodeCoverage\DependencyInjection;
15
16
use Doyo\Bridge\CodeCoverage\Configuration;
17
use Symfony\Component\Config\FileLocator;
18
use Symfony\Component\DependencyInjection\ContainerBuilder;
19
use Symfony\Component\DependencyInjection\Extension\Extension;
20
use Symfony\Component\DependencyInjection\Loader\XmlFileLoader;
21
22
class CodeCoverageExtension extends Extension
23
{
24 3
    public function load(array $configs, ContainerBuilder $container)
25
    {
26 3
        $locator = new FileLocator(__DIR__.'/../Resources/config');
27 3
        $loader  = new XmlFileLoader($container, $locator);
28
29 3
        $configuration = $this->processConfiguration(new Configuration(), $configs);
30
31 3
        $container->setParameter('reports', $configuration['reports']);
32 3
        $container->setParameter('config.filter', $configuration['filter']);
33
34 3
        $loader->load('code_coverage.xml');
35 3
        $loader->load('reports.xml');
36 3
    }
37
38 3
    public function getAlias()
39
    {
40 3
        return 'coverage';
41
    }
42
}
43