CoveragePass   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 10
Duplicated Lines 0 %

Test Coverage

Coverage 0%

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A process() 0 8 1
1
<?php
2
3
/*
4
 * This file is part of the doyo/code-coverage project.
5
 *
6
 * (c) Anthonius Munthi <https://itstoni.com>
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\CodeCoverage\Compiler;
15
16
use Doyo\Behat\CodeCoverage\Listener\CoverageListener;
17
use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface;
18
use Symfony\Component\DependencyInjection\ContainerBuilder;
19
use Symfony\Component\DependencyInjection\Definition;
20
use Symfony\Component\DependencyInjection\Reference;
21
22
class CoveragePass implements CompilerPassInterface
23
{
24
    public function process(ContainerBuilder $container)
25
    {
26
        $listener = new Definition(CoverageListener::class);
27
        $listener->addArgument(new Reference('doyo.coverage'));
28
        $listener->addArgument($container->getParameterBag()->get('doyo.coverage_enabled'));
29
        $listener->addTag('event_dispatcher.subscriber');
30
31
        $container->setDefinition('doyo.coverage.listener', $listener);
32
    }
33
}
34