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