Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
| Total | |
0.00% |
0 / 6 |
|
0.00% |
0 / 1 |
CRAP | |
0.00% |
0 / 1 |
| SettlementStatus | |
0.00% |
0 / 6 |
|
0.00% |
0 / 1 |
30 | |
0.00% |
0 / 1 |
| label | |
0.00% |
0 / 6 |
|
0.00% |
0 / 1 |
30 | |||
| 1 | <?php |
| 2 | |
| 3 | namespace App\Enums; |
| 4 | |
| 5 | enum SettlementStatus: string |
| 6 | { |
| 7 | case Draft = 'draft'; |
| 8 | case Closed = 'closed'; |
| 9 | case Paid = 'paid'; |
| 10 | case Cancelled = 'cancelled'; |
| 11 | |
| 12 | public function label(): string |
| 13 | { |
| 14 | return match ($this) { |
| 15 | self::Draft => 'Rascunho', |
| 16 | self::Closed => 'Fechado', |
| 17 | self::Paid => 'Pago', |
| 18 | self::Cancelled => 'Cancelado', |
| 19 | }; |
| 20 | } |
| 21 | } |