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

StyleMode   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 18
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 9
dl 0
loc 18
rs 10
c 0
b 0
f 0
wmc 3

2 Methods

Rating   Name   Duplication   Size   Complexity  
A isStylingEnabled() 0 3 1
A lowest() 0 6 2
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