Passed
Pull Request — master (#73)
by
unknown
11:03
created

CustomerState::isDeleted()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 1
c 1
b 0
f 0
dl 0
loc 3
rs 10
cc 1
nc 1
nop 1
1
<?php declare(strict_types=1);
2
3
namespace hiqdev\php\billing\customer;
4
5
enum CustomerState: string
6
{
7
    case BLOCKED = 'blocked';
8
    case DELETED = 'deleted';
9
    case NEW = 'new';
10
    case OK = 'ok';
11
12
    public static function isDeleted(CustomerInterface $customer): bool
13
    {
14
        return $customer->getState() === self::DELETED;
15
    }
16
17
    public static function deleted(): CustomerState
18
    {
19
        return self::DELETED;
20
    }
21
}
22