Total Complexity | 10 |
Total Lines | 59 |
Duplicated Lines | 0 % |
Changes | 5 | ||
Bugs | 1 | Features | 2 |
1 | <?php declare(strict_types=1); |
||
5 | class CustomerState |
||
6 | { |
||
7 | public const BLOCKED = 'blocked'; |
||
8 | |||
9 | public const DELETED = 'deleted'; |
||
10 | |||
11 | public const NEW = 'new'; |
||
12 | |||
13 | public const OK = 'ok'; |
||
14 | |||
15 | private function __construct(protected string $state = self::NEW) |
||
16 | { |
||
17 | } |
||
18 | |||
19 | public function getName(): string |
||
22 | } |
||
23 | |||
24 | public static function isDeleted(CustomerInterface $customer): bool |
||
27 | } |
||
28 | |||
29 | public static function deleted(): CustomerState |
||
32 | } |
||
33 | |||
34 | public static function blocked(): CustomerState |
||
35 | { |
||
36 | return new self(self::BLOCKED); |
||
37 | } |
||
38 | |||
39 | public static function new(): CustomerState |
||
42 | } |
||
43 | |||
44 | public static function ok(): CustomerState |
||
45 | { |
||
46 | return new self(self::OK); |
||
47 | } |
||
48 | |||
49 | public static function fromString(string $name): self |
||
64 | } |
||
65 | } |
||
66 |