Passed
Push — master ( 05cc9e...6196c7 )
by Alec
02:39
created

onWindows()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 1
nc 1
nop 0
dl 0
loc 3
rs 10
c 0
b 0
f 0
1
<?php declare(strict_types=1);
2
3
namespace AlecRabbit;
4
5
// @codeCoverageIgnoreStart
6
define(__NAMESPACE__ . '\\' . 'ESC', "\033");
7
define(__NAMESPACE__ . '\\' . 'CSI', ESC . '[');
8
9
define(__NAMESPACE__ . '\\' . 'ENV_ANSICON', 'ANSICON');
10
define(__NAMESPACE__ . '\\' . 'ENV_DOCKER_TERM', 'DOCKER_TERM');
11
define(__NAMESPACE__ . '\\' . 'ENV_TERM', 'TERM');
12
define(__NAMESPACE__ . '\\' . 'ENV_TERM_PROGRAM', 'TERM_PROGRAM');
13
define(__NAMESPACE__ . '\\' . 'ENV_CON_EMU_ANSI', 'ConEmuANSI');
14
define(__NAMESPACE__ . '\\' . 'NEEDLE_256_COLOR', '256color');
15
define(__NAMESPACE__ . '\\' . 'NEEDLE_TRUECOLOR', 'truecolor');
16
define(__NAMESPACE__ . '\\' . 'XTERM', 'xterm');
17
18
define(__NAMESPACE__ . '\\' . 'TRUECOLOR_TERMINAL', 65535); // for future versions
19
define(__NAMESPACE__ . '\\' . 'COLOR256_TERMINAL', 255);
20
define(__NAMESPACE__ . '\\' . 'COLOR_TERMINAL', 16);
21
define(__NAMESPACE__ . '\\' . 'NO_COLOR_TERMINAL', 0);
22
23
define(
24
    __NAMESPACE__ . '\\' . 'ALLOWED_COLOR_TERMINAL',
25
    [
26
        TRUECOLOR_TERMINAL,
27
        COLOR256_TERMINAL,
28
        COLOR_TERMINAL,
29
        NO_COLOR_TERMINAL,
30
    ]
31
);
32
33
define(
34
    __NAMESPACE__ . '\\' . 'TERMINAL_COLOR_MODES',
35
    [
36
        TRUECOLOR_TERMINAL => 'TRUECOLOR',
37
        COLOR256_TERMINAL => '256 COLOR',
38
        COLOR_TERMINAL => '16 COLOR',
39
        NO_COLOR_TERMINAL => 'NO COLOR',
40
    ]
41
);
42
43
if (!\function_exists('onWindows')) {
44
    /**
45
     * @return bool
46
     */
47
    function onWindows(): bool
48
    {
49
        return '\\' === \DIRECTORY_SEPARATOR;
50
    }
51
}