IncidentStatus   A
last analyzed

Complexity

Total Complexity 7

Size/Duplication

Total Lines 67
Duplicated Lines 0 %

Coupling/Cohesion

Components 2
Dependencies 1

Importance

Changes 0
Metric Value
wmc 7
lcom 2
cbo 1
dl 0
loc 67
c 0
b 0
f 0
rs 10

7 Methods

Rating   Name   Duplication   Size   Complexity  
A isLast() 0 4 1
A isStored() 0 4 1
A isDeleted() 0 4 1
A isSuppressed() 0 4 1
A setStored() 0 4 1
A setDeleted() 0 4 1
A setSuppressed() 0 4 1
1
<?php
2
3
namespace Spiral\Snapshotter\AggregationHandler\Database\Types;
4
5
use Spiral\ORM\Columns\EnumColumn;
6
7
class IncidentStatus extends EnumColumn
8
{
9
    /**
10
     * Statuses.
11
     */
12
    const STORED     = 'stored';
13
    const DELETED    = 'deleted';
14
    const SUPPRESSED = 'suppressed';
15
    const LAST       = 'last';
16
17
    /**
18
     * Values.
19
     */
20
    const VALUES  = [self::STORED, self::DELETED, self::SUPPRESSED, self::LAST];
21
22
    /**
23
     * Default values.
24
     */
25
    const DEFAULT = self::LAST;
26
27
    /**
28
     * @return bool
29
     */
30
    public function isLast(): bool
31
    {
32
        return $this->packValue() == self::LAST;
33
    }
34
35
    /**
36
     * @return bool
37
     */
38
    public function isStored(): bool
39
    {
40
        return $this->packValue() == self::STORED;
41
    }
42
43
    /**
44
     * @return bool
45
     */
46
    public function isDeleted(): bool
47
    {
48
        return $this->packValue() == self::DELETED;
49
    }
50
51
    /**
52
     * @return bool
53
     */
54
    public function isSuppressed(): bool
55
    {
56
        return $this->packValue() == self::SUPPRESSED;
57
    }
58
59
    public function setStored()
60
    {
61
        $this->setValue(self::STORED);
62
    }
63
64
    public function setDeleted()
65
    {
66
        $this->setValue(self::DELETED);
67
    }
68
69
    public function setSuppressed()
70
    {
71
        $this->setValue(self::SUPPRESSED);
72
    }
73
}