Code Duplication    Length = 32-32 lines in 2 locations

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

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

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

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