Passed
Push — master ( 1dcfa7...349aa8 )
by Alec
02:17
created

AbstractXTermTerminal   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 15
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
eloc 6
c 0
b 0
f 0
dl 0
loc 15
ccs 4
cts 4
cp 1
rs 10
wmc 2

1 Method

Rating   Name   Duplication   Size   Complexity  
A isXterm() 0 7 2
1
<?php declare(strict_types=1);
2
3
namespace AlecRabbit\Cli\Tools\Core;
4
5
use AlecRabbit\Cli\Tools\EnvCheck;
6
7
abstract class AbstractXTermTerminal extends AbstractTerminal
8
{
9
    /** @var null|bool */
10
    protected static $isXterm;
11
12
    /**
13
     * @return bool
14
     */
15 1
    protected static function isXterm(): bool
16
    {
17 1
        if (null !== static::$isXterm) {
18 1
            return static::$isXterm;
19
        }
20
        return
21 1
            static::$isXterm = EnvCheck::isXterm();
22
    }
23
}
24