| Total Complexity | 4 |
| Total Lines | 34 |
| Duplicated Lines | 0 % |
| Coverage | 90% |
| Changes | 0 | ||
| 1 | <?php |
||
| 5 | class TicketReservationRequest |
||
| 6 | { |
||
| 7 | private $ticketType; |
||
| 8 | private $quantity; |
||
| 9 | |||
| 10 | /** |
||
| 11 | * TicketReservationRequest constructor. |
||
| 12 | * @param $ticketType |
||
| 13 | * @param $quantity |
||
| 14 | */ |
||
| 15 | 2 | public function __construct(TicketType $ticketType, int $quantity) |
|
| 16 | { |
||
| 17 | 2 | if ($quantity < 1) { |
|
| 18 | throw new \DomainException('Quantity must be greater than 0'); |
||
| 19 | } |
||
| 20 | |||
| 21 | 2 | $this->ticketType = $ticketType; |
|
| 22 | 2 | $this->quantity = $quantity; |
|
| 23 | 2 | } |
|
| 24 | |||
| 25 | /** |
||
| 26 | * @return TicketType |
||
| 27 | */ |
||
| 28 | 2 | public function getTicketType() |
|
| 29 | { |
||
| 30 | 2 | return $this->ticketType; |
|
| 31 | } |
||
| 32 | |||
| 33 | /** |
||
| 34 | * @return int |
||
| 35 | */ |
||
| 36 | 2 | public function getQuantity() |
|
| 39 | } |
||
| 40 | } |