Total Complexity | 8 |
Total Lines | 75 |
Duplicated Lines | 0 % |
Changes | 2 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
13 | * @author Remco Tolsma |
||
14 | * @version 2.0.0 |
||
15 | * @since 1.0.0 |
||
16 | */ |
||
17 | class Statuses { |
||
18 | /** |
||
19 | * Open |
||
20 | * |
||
21 | * @var string |
||
22 | */ |
||
23 | const OPEN = 'open'; |
||
24 | |||
25 | /** |
||
26 | * Cancelled |
||
27 | * |
||
28 | * @var string |
||
29 | */ |
||
30 | const CANCELLED = 'cancelled'; |
||
31 | |||
32 | /** |
||
33 | * Paid out |
||
34 | * |
||
35 | * @var string |
||
36 | */ |
||
37 | const PAID_OUT = 'paidout'; |
||
38 | |||
39 | /** |
||
40 | * Paid |
||
41 | * |
||
42 | * @var string |
||
43 | */ |
||
44 | const PAID = 'paid'; |
||
45 | |||
46 | /** |
||
47 | * Expired |
||
48 | * |
||
49 | * @var string |
||
50 | */ |
||
51 | const EXPIRED = 'expired'; |
||
52 | |||
53 | /** |
||
54 | * Pending |
||
55 | * |
||
56 | * @var string |
||
57 | */ |
||
58 | const PENDING = 'pending'; |
||
59 | |||
60 | /** |
||
61 | * Active |
||
62 | * |
||
63 | * @since 1.1.9 |
||
64 | * @var string |
||
65 | */ |
||
66 | const ACTIVE = 'active'; |
||
67 | |||
68 | /** |
||
69 | * Transform an Mollie state to an more global status |
||
70 | * |
||
71 | * @param string $status |
||
72 | */ |
||
73 | public static function transform( $status ) { |
||
74 | switch ( $status ) { |
||
75 | case self::PENDING: |
||
76 | case self::OPEN: |
||
77 | return Core_Statuses::OPEN; |
||
78 | |||
79 | case self::CANCELLED: |
||
80 | return Core_Statuses::CANCELLED; |
||
81 | |||
82 | case self::PAID_OUT: |
||
83 | return Core_Statuses::SUCCESS; |
||
84 | |||
85 | case self::ACTIVE: |
||
86 | return Core_Statuses::ACTIVE; |
||
87 | |||
88 | case self::PAID: |
||
99 |