Completed
Push — main ( 407a1d...b509b5 )
by
unknown
17s queued 14s
created

InteractionTypeEnum::isLike()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
eloc 1
dl 0
loc 3
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 0
1
<?php
2
3
namespace CSlant\LaravelLike\Enums;
4
5
enum InteractionTypeEnum: string
6
{
7
    case DEFAULT = 'default';
8
    case LIKE = 'like';
9
    case DISLIKE = 'dislike';
10
    case LOVE = 'love';
11
12
    /**
13
     * Get the values of the enum.
14
     *
15
     * @return array<int, InteractionTypeEnum>
16
     */
17
    public static function getValues(): array
18
    {
19
        return [
20
            self::LIKE,
21
            self::DISLIKE,
22
            self::LOVE,
23
        ];
24
    }
25
26
    /**
27
     * Get the values of the enum as strings.
28
     *
29
     * @return array<string>
30
     */
31
    public static function getValuesAsStrings(): array
32
    {
33
        return [
34
            self::LIKE->value,
35
            self::DISLIKE->value,
36
            self::LOVE->value,
37
        ];
38
    }
39
40
    /**
41
     * Check if the value is like.
42
     *
43
     * @return bool
44
     */
45
    public function isLike(): bool
46
    {
47
        return $this === self::LIKE;
48
    }
49
50
    /**
51
     * Check if the value is dislike.
52
     *
53
     * @return bool
54
     */
55
    public function isDislike(): bool
56
    {
57
        return $this === self::DISLIKE;
58
    }
59
60
    /**
61
     * Check if the value is love.
62
     *
63
     * @return bool
64
     */
65
    public function isLove(): bool
66
    {
67
        return $this === self::LOVE;
68
    }
69
}
70