| Conditions | 3 |
| Paths | 3 |
| Total Lines | 19 |
| Code Lines | 11 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 16 | public function execute($input, $output) |
||
| 17 | { |
||
| 18 | $parking = $this->repository->get(); |
||
| 19 | |||
| 20 | $columns = "|%5.5s |%-20.20s | %-10.10s |\n"; |
||
| 21 | $output = sprintf($columns, 'Slot No.', 'Registration No', 'Colour'); |
||
| 22 | foreach ($parking->getSlots() as $key => $slot) { |
||
| 23 | if (!$slot->getCar()) { |
||
| 24 | continue; |
||
| 25 | } |
||
| 26 | |||
| 27 | $plate = $slot->getCar()->plate; |
||
| 28 | $colour = $slot->getCar()->colour; |
||
| 29 | |||
| 30 | $output .= sprintf($columns, $key + 1, $plate, $colour); |
||
| 31 | } |
||
| 32 | |||
| 33 | return $output; |
||
| 34 | } |
||
| 35 | |||
| 37 | } |