Total Complexity | 6 |
Total Lines | 46 |
Duplicated Lines | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 1 |
1 | <?php |
||
8 | final class Type |
||
9 | { |
||
10 | /** |
||
11 | * @var int |
||
12 | */ |
||
13 | private $value; |
||
14 | |||
15 | private static $customer = 1; |
||
16 | |||
17 | private static $prospect = 2; |
||
18 | |||
19 | private static $prospectCustomer = 3; |
||
20 | |||
21 | private static $none = 0; |
||
22 | |||
23 | private function __construct($type) |
||
24 | { |
||
25 | Assert::greaterThanEq($type, 0); |
||
26 | Assert::lessThanEq($type, 3); |
||
27 | |||
28 | $this->value = $type; |
||
29 | } |
||
30 | |||
31 | public function type() |
||
32 | { |
||
33 | return $this->value; |
||
34 | } |
||
35 | |||
36 | public static function customer() |
||
37 | { |
||
38 | return new self(self::$customer); |
||
39 | } |
||
40 | |||
41 | public static function prospect() |
||
44 | } |
||
45 | |||
46 | public static function prospectCustomer() |
||
47 | { |
||
48 | return new self(self::$prospectCustomer); |
||
49 | } |
||
50 | |||
51 | public static function none() |
||
54 | } |
||
55 | } |
||
56 |