IncidentStatus::isStored()   A
last analyzed

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 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
}