Passed
Pull Request — master (#5)
by ANTHONIUS
03:34
created

CodeCoverageExtension::load()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 12
Code Lines 7

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 8
CRAP Score 1.0013

Importance

Changes 0
Metric Value
cc 1
eloc 7
nc 1
nop 2
dl 0
loc 12
ccs 8
cts 9
cp 0.8889
crap 1.0013
rs 10
c 0
b 0
f 0
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 1
    public function load(array $configs, ContainerBuilder $container)
25
    {
26 1
        $locator = new FileLocator(__DIR__.'/../Resources/config');
27 1
        $loader  = new XmlFileLoader($container, $locator);
28
29 1
        $configuration = $this->processConfiguration(new Configuration(), $configs);
30
31 1
        $container->setParameter('reports', $configuration['reports']);
32 1
        $container->setParameter('config.filter', $configuration['filter']);
33
34 1
        $loader->load('code_coverage.xml');
35 1
        $loader->load('reports.xml');
36
    }
37
38 1
    public function getAlias()
39
    {
40 1
        return 'coverage';
41
    }
42
}
43