| Conditions | 3 |
| Paths | 4 |
| Total Lines | 14 |
| Code Lines | 8 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 33 | public function execute($input, $output) |
||
| 34 | { |
||
| 35 | $this->validate($input); |
||
| 36 | |||
| 37 | $parking = $this->repository->get(); |
||
| 38 | $slot = $parking->park(new \Parking\Domain\Car($input[0], $input[1])); |
||
| 39 | $this->repository->store($parking); |
||
| 40 | |||
| 41 | if ($slot !== false) { |
||
| 42 | $output = "Allocated slot number: " . $slot; |
||
| 43 | } |
||
| 44 | |||
| 45 | return $output ? $output : "Sorry, parking lot is full"; |
||
| 46 | } |
||
| 47 | |||
| 60 | } |