Completed
Pull Request — master (#112)
by Alessandro
07:59
created

TextToConsole::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 0
Metric Value
cc 1
eloc 3
nc 1
nop 2
dl 0
loc 5
ccs 2
cts 2
cp 1
crap 1
rs 9.4285
c 0
b 0
f 0
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Paraunit\Coverage\Processor;
6
7
use Paraunit\Proxy\Coverage\CodeCoverage;
8
use Symfony\Component\Console\Output\OutputInterface;
9
10
/**
11
 * Class TextToConsole
12
 * @package Paraunit\Proxy\Coverage
13
 */
14
class TextToConsole extends AbstractText
15
{
16
    /** @var OutputInterface */
17
    private $output;
18
19
    /**
20
     * TextToConsole constructor.
21
     * @param OutputInterface $output
22
     * @param bool $showColors
23 3
     */
24
    public function __construct(OutputInterface $output, bool $showColors)
25 3
    {
26 3
        parent::__construct($showColors);
27
        $this->output = $output;
28
    }
29 1
30
    public function process(CodeCoverage $codeCoverage)
31 1
    {
32
        $this->output->writeln($this->getTextCoverage($codeCoverage));
33
    }
34
35
    public static function getConsoleOptionName(): string
36
    {
37
        return 'text-to-console';
38
    }
39
}
40