Passed
Pull Request — master (#73)
by
unknown
10:27
created

CustomerState   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 10
Duplicated Lines 0 %

Importance

Changes 2
Bugs 0 Features 1
Metric Value
wmc 1
eloc 6
c 2
b 0
f 1
dl 0
loc 10
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A isDeleted() 0 3 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 self::tryFrom((string)$customer->getState()) === self::DELETED;
15
    }
16
}
17