Total Complexity | 2 |
Total Lines | 32 |
Duplicated Lines | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
5 | class Location extends Component |
||
6 | { |
||
7 | protected string $name; |
||
8 | protected string $address; |
||
9 | protected float $latitude; |
||
10 | protected float $longitude; |
||
11 | |||
12 | public function __construct(string $name, string $address, float $latitude, float $longitude) |
||
13 | { |
||
14 | $this->name = $name; |
||
15 | $this->address = $address; |
||
16 | $this->latitude = $latitude; |
||
17 | $this->longitude = $longitude; |
||
18 | } |
||
19 | |||
20 | // TODO: PHP 8 |
||
21 | // public function __construct( |
||
22 | // protected string $name, |
||
23 | // protected string $address, |
||
24 | // protected float $latitude, |
||
25 | // protected float $longitude |
||
26 | // ) {} |
||
27 | |||
28 | public function toArray(): array |
||
37 | ], |
||
38 | ]; |
||
41 |