LogBuilder::whereLevel()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 1
c 1
b 0
f 0
nc 1
nop 1
dl 0
loc 3
ccs 0
cts 2
cp 0
crap 2
rs 10
1
<?php
2
3
declare(strict_types=1);
4
5
namespace JustSteveKing\EloquentLogDriver\Models;
6
7
use Illuminate\Support\Str;
8
use Illuminate\Database\Eloquent\Builder;
9
10
class LogBuilder extends Builder
11
{
12
    public function whereLevel(string $level): self
13
    {
14
        return $this->where('level', Str::upper($level));
15
    }
16
17
    public function whereInfo(): self
18
    {
19
        return $this->whereLevel('INFO');
20
    }
21
22
    public function whereDebug(): self
23
    {
24
        return $this->whereLevel('DEBUG');
25
    }
26
27
    public function whereNotice(): self
28
    {
29
        return $this->whereLevel('NOTICE');
30
    }
31
32
    public function whereWarning(): self
33
    {
34
        return $this->whereLevel('WARNING');
35
    }
36
37
    public function whereError(): self
38
    {
39
        return $this->whereLevel('ERROR');
40
    }
41
42
    public function whereCritical(): self
43
    {
44
        return $this->whereLevel('CRITICAL');
45
    }
46
47
    public function whereAlert(): self
48
    {
49
        return $this->whereLevel('ALERT');
50
    }
51
52
    public function whereEmergency(): self
53
    {
54
        return $this->whereLevel('EMERGENCY');
55
    }
56
}
57