1 | <?php |
||
7 | class Parking |
||
8 | { |
||
9 | |||
10 | /** |
||
11 | * @var array |
||
12 | */ |
||
13 | private $slots = []; |
||
14 | |||
15 | /** |
||
16 | * Parking constructor. |
||
17 | * @param array $slots |
||
18 | */ |
||
19 | public function __construct($slots = array()) |
||
23 | |||
24 | /** |
||
25 | * Park method |
||
26 | * |
||
27 | * @param Car $car |
||
28 | * @return bool|int |
||
29 | */ |
||
30 | public function park(Car $car) |
||
41 | |||
42 | /** |
||
43 | * Leave method |
||
44 | * |
||
45 | * @param $key |
||
46 | * @return bool |
||
47 | */ |
||
48 | public function leave($key) |
||
58 | |||
59 | /** |
||
60 | * Getter of slot |
||
61 | * |
||
62 | * @param $key |
||
63 | * @return bool|mixed |
||
64 | */ |
||
65 | public function getSlot($key) |
||
73 | |||
74 | /** |
||
75 | * Getter of slots |
||
76 | * |
||
77 | * @return array |
||
78 | */ |
||
79 | public function getSlots() |
||
83 | |||
84 | |||
85 | } |