Level   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 26
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 10
c 0
b 0
f 0
dl 0
loc 26
rs 10
wmc 1

1 Method

Rating   Name   Duplication   Size   Complexity  
A isToLog() 0 3 1
1
<?php
2
3
namespace pjpawel\LightApi\Component\Logger\SimpleLogger;
4
5
enum Level: int
6
{
7
8
    case Debug = 100;
9
10
    case Info = 200;
11
12
    case Notice = 250;
13
14
    case Warning = 300;
15
16
    case Error = 400;
17
18
    case Critical = 500;
19
20
    case Alert = 550;
21
22
    case Emergency = 600;
23
24
    /**
25
     * @param Level $level Minimal log level
26
     * @return bool
27
     */
28
    public function isToLog(Level $level): bool
29
    {
30
        return $this->value >= $level->value;
31
    }
32
33
    /*public static function fromName(string $name): self
34
    {
35
        return match ($name) {
36
            'debug', 'Debug', 'DEBUG' => self::Debug,
37
            'info', 'Info', 'INFO' => self::Info,
38
            'notice', 'Notice', 'NOTICE' => self::Notice,
39
            'warning', 'Warning', 'WARNING' => self::Warning,
40
            'error', 'Error', 'ERROR' => self::Error,
41
            'critical', 'Critical', 'CRITICAL' => self::Critical,
42
            'alert', 'Alert', 'ALERT' => self::Alert,
43
            'emergency', 'Emergency', 'EMERGENCY' => self::Emergency,
44
        };
45
    }*/
46
47
}
48