Completed
Push — master ( 0edf84...a8febf )
by raphael
01:18
created

Level::all()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 4
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 0
1
<?php
2
3
namespace Rap2hpoutre\LaravelLogViewer;
4
5
/**
6
 * Class Level
7
 * @package Rap2hpoutre\LaravelLogViewer
8
 */
9
class Level
10
{
11
    /**
12
     * @var array
13
     */
14
    private $levels_classes = [
15
        'debug' => 'info',
16
        'info' => 'info',
17
        'notice' => 'info',
18
        'warning' => 'warning',
19
        'error' => 'danger',
20
        'critical' => 'danger',
21
        'alert' => 'danger',
22
        'emergency' => 'danger',
23
        'processed' => 'info',
24
        'failed' => 'warning',
25
    ];
26
27
    /**
28
     * @var array
29
     */
30
    private $levels_imgs = [
31
        'debug' => 'info-circle',
32
        'info' => 'info-circle',
33
        'notice' => 'info-circle',
34
        'warning' => 'exclamation-triangle',
35
        'error' => 'exclamation-triangle',
36
        'critical' => 'exclamation-triangle',
37
        'alert' => 'exclamation-triangle',
38
        'emergency' => 'exclamation-triangle',
39
        'processed' => 'info-circle',
40
        'failed' => 'exclamation-triangle'
41
    ];
42
43
    /**
44
     * @return array
45
     */
46
    public function all()
47
    {
48
        return array_keys($this->levels_imgs);
49
    }
50
51
    /**
52
     * @param $level
53
     * @return string
54
     */
55
    public function img($level)
56
    {
57
        return $this->levels_imgs[$level];
58
    }
59
60
    /**
61
     * @param $level
62
     * @return string
63
     */
64
    public function cssClass($level)
65
    {
66
        return $this->levels_classes[$level];
67
    }
68
}