Code Duplication    Length = 32-32 lines in 3 locations

src/Paraunit/Coverage/Processor/Clover.php 1 location

@@ 15-46 (lines=32) @@
12
 * Class Clover
13
 * @package Paraunit\Proxy\Coverage
14
 */
15
class Clover implements CoverageProcessorInterface
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
    public function __construct(OutputFile $targetFile)
28
    {
29
        $this->clover = new PHPUnitClover();
30
        $this->targetFile = $targetFile;
31
    }
32
33
    /**
34
     * @param CodeCoverage $codeCoverage
35
     * @throws \RuntimeException
36
     */
37
    public function process(CodeCoverage $codeCoverage)
38
    {
39
        $this->clover->process($codeCoverage, $this->targetFile->getFilePath());
40
    }
41
42
    public static function getConsoleOptionName(): string
43
    {
44
        return 'clover';
45
    }
46
}
47

src/Paraunit/Coverage/Processor/Crap4j.php 1 location

@@ 15-46 (lines=32) @@
12
 * Class Crap4jResult
13
 * @package Paraunit\Proxy\Coverage
14
 */
15
class Crap4j implements CoverageProcessorInterface
16
{
17
    /** @var PHPUnitCrap4j */
18
    private $crap4j;
19
20
    /** @var OutputFile */
21
    private $targetFile;
22
23
    /**
24
     * Crap4j constructor.
25
     * @param OutputFile $targetFile
26
     */
27
    public function __construct(OutputFile $targetFile)
28
    {
29
        $this->crap4j = new PHPUnitCrap4j();
30
        $this->targetFile = $targetFile;
31
    }
32
33
    /**
34
     * @param CodeCoverage $codeCoverage
35
     * @throws \RuntimeException
36
     */
37
    public function process(CodeCoverage $codeCoverage)
38
    {
39
        $this->crap4j->process($codeCoverage, $this->targetFile->getFilePath());
40
    }
41
42
    public static function getConsoleOptionName(): string
43
    {
44
        return 'crap4j';
45
    }
46
}
47

src/Paraunit/Coverage/Processor/Php.php 1 location

@@ 15-46 (lines=32) @@
12
 * Class PhpResult
13
 * @package Paraunit\Proxy\Coverage
14
 */
15
class Php implements CoverageProcessorInterface
16
{
17
    /** @var PHPUnitPhp */
18
    private $php;
19
20
    /** @var OutputFile */
21
    private $targetFile;
22
23
    /**
24
     * Php constructor.
25
     * @param OutputFile $targetFile
26
     */
27
    public function __construct(OutputFile $targetFile)
28
    {
29
        $this->php = new PHPUnitPhp();
30
        $this->targetFile = $targetFile;
31
    }
32
33
    /**
34
     * @param CodeCoverage $codeCoverage
35
     * @throws \RuntimeException
36
     */
37
    public function process(CodeCoverage $codeCoverage)
38
    {
39
        $this->php->process($codeCoverage, $this->targetFile->getFilePath());
40
    }
41
42
    public static function getConsoleOptionName(): string
43
    {
44
        return 'php';
45
    }
46
}
47