Completed
Push — master ( 9a7b87...ad20a3 )
by Alessandro
03:07
created

Xml::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 3

Duplication

Lines 5
Ratio 100 %

Code Coverage

Tests 0
CRAP Score 2

Importance

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