Total Complexity | 5 |
Total Lines | 38 |
Duplicated Lines | 0 % |
Changes | 0 |
1 | <?php |
||
8 | final class PassengerTypeQuantity implements ValueObjectInterface |
||
9 | { |
||
10 | public const PASSENGER_TYPE_ADULT = 'adult'; |
||
11 | public const PASSENGER_TYPE_CHILD = 'child'; |
||
12 | public const PASSENGER_TYPE_INFANT = 'infant'; |
||
13 | |||
14 | private static $passengerTypeEnum = ['adult', 'child', 'infant']; |
||
15 | |||
16 | private $quantities; |
||
17 | |||
18 | public function __construct() |
||
21 | } |
||
22 | |||
23 | public function withQuantity(string $passengerTye, int $quantity) : PassengerTypeQuantity |
||
31 | } |
||
32 | |||
33 | private function checkPassengerType(string $checkPassengerType) : void |
||
34 | { |
||
35 | if (!\in_array($checkPassengerType, self::$passengerTypeEnum, true)) { |
||
36 | throw new InvalidArgumentException( |
||
37 | 'Invalid PassengerTypeQuantity.Code value provided. Must be one of these: ' . |
||
38 | implode(', ', self::$passengerTypeEnum) |
||
39 | ); |
||
40 | } |
||
41 | } |
||
42 | |||
43 | public function getValue() : array |
||
46 | } |
||
47 | } |
||
48 |