IO::sessionError()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 4
CRAP Score 1

Importance

Changes 0
Metric Value
cc 1
eloc 3
nc 1
nop 2
dl 0
loc 5
ccs 4
cts 4
cp 1
crap 1
rs 10
c 0
b 0
f 0
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