Clover::__construct()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 5

Duplication

Lines 5
Ratio 100 %

Code Coverage

Tests 3
CRAP Score 1

Importance

Changes 0
Metric Value
dl 5
loc 5
ccs 3
cts 3
cp 1
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 1
crap 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Paraunit\Coverage\Processor;
6
7
use Paraunit\Configuration\OutputFile;
8
use SebastianBergmann\CodeCoverage\CodeCoverage;
9
use SebastianBergmann\CodeCoverage\Report\Clover as PHPUnitClover;
10
11
/**
12
 * Class Clover
13
 * @package Paraunit\Proxy\Coverage
14
 */
15 View Code Duplication
class Clover implements CoverageProcessorInterface
0 ignored issues
show
Duplication introduced by
This class seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
16
{
17
    /** @var PHPUnitClover */
18
    private $clover;
19
20
    /** @var OutputFile */
21
    private $targetFile;
22
23
    /**
24
     * Clover constructor.
25
     * @param OutputFile $targetFile
26
     */
27 2
    public function __construct(OutputFile $targetFile)
28
    {
29 2
        $this->clover = new PHPUnitClover();
30 2
        $this->targetFile = $targetFile;
31
    }
32
33
    /**
34
     * @param CodeCoverage $codeCoverage
35
     * @throws \RuntimeException
36
     */
37 1
    public function process(CodeCoverage $codeCoverage)
38
    {
39 1
        $this->clover->process($codeCoverage, $this->targetFile->getFilePath());
40
    }
41
42 26
    public static function getConsoleOptionName(): string
43
    {
44 26
        return 'clover';
45
    }
46
}
47