Failed Conditions
Push — master ( 2be5da...8667b1 )
by Adrien
04:39
created

BookingType   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 35
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 1
eloc 12
dl 0
loc 35
ccs 7
cts 7
cp 1
rs 10
c 1
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A getDescription() 0 8 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Application\Enum;
6
7
use Ecodev\Felix\Api\Enum\LocalizedPhpEnumType;
8
9
enum BookingType: string implements LocalizedPhpEnumType
10
{
11
    /**
12
     * A user assigns and approves his own booking.
13
     */
14
    case SelfApproved = 'self_approved';
15
16
    /**
17
     * A user requests an admin to assign and approve an **equivalent** booking.
18
     */
19
    case Application = 'application';
20
21
    /**
22
     * An admin assigns and approves a booking **equivalent** to the one requested by a user.
23
     */
24
    case AdminAssigned = 'admin_assigned';
25
26
    /**
27
     * A user assigns, but an admin approves, the exact same booking.
28
     */
29
    case AdminApproved = 'admin_approved';
30
31
    /**
32
     * The system automatically assigns and approves those bookings upon user registration confirmation.
33
     */
34
    case Mandatory = 'mandatory';
35
36 1
    public function getDescription(): string
37
    {
38 1
        return match ($this) {
39 1
            self::SelfApproved => 'Carnet de sortie',
40 1
            self::Application => 'Stockage et services pour demande',
41 1
            self::AdminAssigned => 'Stockage et services effectifs',
42 1
            self::AdminApproved => 'Cours',
43 1
            self::Mandatory => 'Services obligatoires',
44 1
        };
45
    }
46
}
47