IO   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 19
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
eloc 7
dl 0
loc 19
ccs 8
cts 8
cp 1
rs 10
c 0
b 0
f 0
wmc 3

3 Methods

Rating   Name   Duplication   Size   Complexity  
A hasError() 0 3 1
A setHasError() 0 3 1
A sessionError() 0 5 1
1
<?php
2
3
/*
4
 * This file is part of the doyo/behat-code-coverage project.
5
 *
6
 * (c) Anthonius Munthi <[email protected]>
7
 *
8
 * For the full copyright and license information, please view the LICENSE
9
 * file that was distributed with this source code.
10
 */
11
12
declare(strict_types=1);
13
14
namespace Doyo\Behat\Coverage\Console;
15
16
use Symfony\Component\Console\Style\SymfonyStyle;
17
18
class IO extends SymfonyStyle implements ConsoleIO
19
{
20
    private $hasError = false;
21
22 4
    public function setHasError(bool $flag)
23
    {
24 4
        $this->hasError = $flag;
25
    }
26
27 4
    public function hasError(): bool
28
    {
29 4
        return true === $this->hasError;
30
    }
31
32 1
    public function sessionError($sessionName, $message)
33
    {
34 1
        $this->hasError = true;
35 1
        $message        = sprintf('<info><comment>sessions.%s</comment> >> %s</info>', $sessionName, $message);
36 1
        $this->writeln($message);
37
    }
38
}
39