Passed
Push — master ( 200d88...9b81d7 )
by Alec
02:43 queued 15s
created

StyleMode::lowest()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 6
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 2
eloc 3
nc 2
nop 1
dl 0
loc 6
rs 10
c 0
b 0
f 0
1
<?php
2
3
declare(strict_types=1);
4
5
namespace AlecRabbit\Spinner\Contract;
6
7
enum StyleMode: int
8
{
9
    case NONE = 0;
10
    case ANSI4 = 16;
11
    case ANSI8 = 256;
12
    case ANSI24 = 65535;
13
14
    public function lowest(self $other): self
15
    {
16
        if ($this->value <= $other->value) {
17
            return $this;
18
        }
19
        return $other;
20
    }
21
22
    public function isStylingEnabled(): bool
23
    {
24
        return $this->value > 0;
25
    }
26
}
27