-
Notifications
You must be signed in to change notification settings - Fork 0
/
car.php
52 lines (44 loc) · 983 Bytes
/
car.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
<?php
enum Fuel: string
{
case gasoline = 'gasoline';
case gasoil = 'gasoil';
case hybrid = 'hybrid';
case electric = 'electric';
}
class Car
{
private int $cylinder;
private string $brand;
private string $registration;
private Fuel $fuel;
private string $color;
public function __construct(int $cylinder, string $brand, string $registration, Fuel $fuel, string $color)
{
$this->cylinder = $cylinder;
$this->brand = $brand;
$this->registration = $registration;
$this->fuel = $fuel;
$this->color = $color;
}
public function getCylinder()
{
return $this->cylinder;
}
public function getBrand()
{
return $this->brand;
}
public function getregistration()
{
return $this->registration;
}
public function getFuel()
{
return $this->fuel;
}
public function getColor()
{
return $this->color;
}
}