Total Complexity | 6 |
Total Lines | 61 |
Duplicated Lines | 0 % |
Coverage | 75% |
Changes | 0 |
1 | <?php |
||
10 | class Map |
||
11 | { |
||
12 | /** |
||
13 | * @var Map |
||
14 | */ |
||
15 | protected $map; |
||
16 | |||
17 | /** |
||
18 | * Map constructor |
||
19 | * |
||
20 | * @param float $lat |
||
21 | * @param float $lng |
||
22 | * @param float $distance |
||
23 | */ |
||
24 | 4 | public function __construct ( float $lat, float $lng, int $distance ) |
|
25 | { |
||
26 | 4 | $this->map = [ |
|
|
|||
27 | 4 | "lat" => ( float ) $lat, |
|
28 | 4 | "lng" => ( float ) $lng, |
|
29 | 4 | "distance" => ( int ) $distance |
|
30 | ]; |
||
31 | 4 | } |
|
32 | |||
33 | /** |
||
34 | * @return float Latitude |
||
35 | */ |
||
36 | 4 | public function getLat () : float |
|
37 | { |
||
38 | 4 | return $this->map[ "lat" ]; |
|
39 | } |
||
40 | |||
41 | /** |
||
42 | * @return float Longitude |
||
43 | */ |
||
44 | 4 | public function getLng () : float |
|
45 | { |
||
46 | 4 | return $this->map[ "lng" ]; |
|
47 | } |
||
48 | |||
49 | /** |
||
50 | * @return int Distance |
||
51 | */ |
||
52 | 4 | public function getDistance () : int |
|
53 | { |
||
54 | 4 | return $this->map[ "distance" ]; |
|
55 | } |
||
56 | |||
57 | /** |
||
58 | * @return string |
||
59 | */ |
||
60 | public function __toString () : string |
||
63 | } |
||
64 | |||
65 | /** |
||
66 | * @return array |
||
67 | */ |
||
68 | public function __toArray () : array |
||
71 | } |
||
72 | } |
Our type inference engine has found an assignment to a property that is incompatible with the declared type of that property.
Either this assignment is in error or the assigned type should be added to the documentation/type hint for that property..