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

Text::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
dl 0
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\OutputFile;
7
use Paraunit\Proxy\Coverage\CodeCoverage;
8
9
/**
10
 * Class Text
11
 * @package Paraunit\Proxy\Coverage
12
 */
13
class Text extends AbstractText
14
{
15
    /** @var  OutputFile */
16
    private $targetFile;
17
18
    /**
19
     * Text constructor.
20
     * @param OutputFile $targetFile
21
     */
22
    public function __construct(OutputFile $targetFile)
23
    {
24
        parent::__construct();
25
        $this->targetFile = $targetFile;
26
    }
27
28
    /**
29
     * @param CodeCoverage $coverage
30
     * @throws \RuntimeException
31
     */
32
    public function process(CodeCoverage $coverage)
33
    {
34
        file_put_contents(
35
            $this->targetFile->getFilePath(),
36
            $this->getTextCoverage($coverage)
37
        );
38
    }
39
}
40