Completed
Push — master ( bf487d...84f230 )
by Alessandro
10:10
created

Php::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 3

Duplication

Lines 5
Ratio 100 %

Code Coverage

Tests 3
CRAP Score 1

Importance

Changes 1
Bugs 0 Features 0
Metric Value
dl 5
loc 5
ccs 3
cts 3
cp 1
rs 9.4285
c 1
b 0
f 0
cc 1
eloc 3
nc 1
nop 1
crap 1
1
<?php
2
declare(strict_types=1);
3
4
namespace Paraunit\Coverage\Processor;
5
6
use Paraunit\Configuration\OutputFile;
7
use Paraunit\Proxy\Coverage\CodeCoverage;
8
use SebastianBergmann\CodeCoverage\Report\PHP as PHPUnitPhp;
9
10
/**
11
 * Class PhpResult
12
 * @package Paraunit\Proxy\Coverage
13
 */
14 View Code Duplication
class Php 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...
15
{
16
    /** @var PHPUnitPhp */
17
    private $php;
18
19
    /** @var OutputFile */
20
    private $targetFile;
21
22
    /**
23
     * Php constructor.
24
     * @param OutputFile $targetFile
25
     */
26 2
    public function __construct(OutputFile $targetFile)
27
    {
28 2
        $this->php = new PHPUnitPhp();
29 2
        $this->targetFile = $targetFile;
30
    }
31
32
    /**
33
     * @param CodeCoverage $codeCoverage
34
     * @throws \RuntimeException
35
     */
36 1
    public function process(CodeCoverage $codeCoverage)
37
    {
38 1
        $this->php->process($codeCoverage, $this->targetFile->getFilePath());
39
    }
40
}
41