CoverageCheckStyle::error()   A
last analyzed

Complexity

Conditions 2
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 2

Importance

Changes 1
Bugs 0 Features 1
Metric Value
cc 2
eloc 2
c 1
b 0
f 1
nc 1
nop 2
dl 0
loc 4
ccs 2
cts 2
cp 1
crap 2
rs 10
1
<?php
2
3
declare(strict_types=1);
4
5
/**
6
 * This file is part of PHPUnit Coverage Check.
7
 *
8
 * (c) Eric Sizemore <[email protected]>
9
 * (c) Richard Regeer <[email protected]>
10
 *
11
 * This source file is subject to the MIT license. For the full copyright,
12
 * license information, and credits/acknowledgements, please view the LICENSE
13
 * and README files that were distributed with this source code.
14
 */
15
16
namespace Esi\CoverageCheck\Style;
17
18
use Override;
19
use Symfony\Component\Console\Style\SymfonyStyle;
20
21
/**
22
 * @see SymfonyStyle
23
 */
24
final class CoverageCheckStyle extends SymfonyStyle
25
{
26 8
    #[Override]
27
    public function error(array|string $message, bool $onlyPercentage = false): void
28
    {
29 8
        $this->block($message, ($onlyPercentage ? null : 'ERROR'), 'fg=white;bg=red', ' ', true);
30
    }
31
32 2
    #[Override]
33
    public function success(array|string $message, bool $onlyPercentage = false): void
34
    {
35 2
        $this->block($message, ($onlyPercentage ? null : 'OK'), 'fg=black;bg=green', ' ', true);
36
    }
37
38 2
    #[Override]
39
    public function table(array $headers, array $rows): void
40
    {
41 2
        $this->createTable()
42 2
            ->setHeaders($headers)
43 2
            ->setRows($rows)
44 2
            ->setColumnMaxWidth(0, 70)
45 2
            ->render()
46 2
        ;
47
48 2
        $this->newLine();
49
    }
50
}
51