1 | <?php namespace Arcanedev\GeoLocation\Google\Directions\Entities; |
||
18 | class Leg implements Arrayable, Jsonable, JsonSerializable |
||
19 | { |
||
20 | /* ----------------------------------------------------------------- |
||
21 | | Traits |
||
22 | | ----------------------------------------------------------------- |
||
23 | */ |
||
24 | |||
25 | use CanBeJsonable; |
||
26 | |||
27 | /* ----------------------------------------------------------------- |
||
28 | | Properties |
||
29 | | ----------------------------------------------------------------- |
||
30 | */ |
||
31 | |||
32 | /** |
||
33 | * The start address. |
||
34 | * |
||
35 | * @var string |
||
36 | */ |
||
37 | protected $startAddress; |
||
38 | |||
39 | /** |
||
40 | * The start location. |
||
41 | * |
||
42 | * @var \Arcanedev\GeoLocation\Contracts\Entities\Coordinates\Position |
||
43 | */ |
||
44 | protected $startLocation; |
||
45 | |||
46 | /** |
||
47 | * The end address |
||
48 | * |
||
49 | * @var string |
||
50 | */ |
||
51 | protected $endAddress; |
||
52 | |||
53 | /** |
||
54 | * The end location. |
||
55 | * |
||
56 | * @var \Arcanedev\GeoLocation\Contracts\Entities\Coordinates\Position |
||
57 | */ |
||
58 | protected $endLocation; |
||
59 | |||
60 | /** |
||
61 | * The distance (text + value). |
||
62 | * |
||
63 | * @var \Arcanedev\GeoLocation\Entities\Measures\Distance |
||
64 | */ |
||
65 | protected $distance; |
||
66 | |||
67 | /** |
||
68 | * The duration (text + value). |
||
69 | * |
||
70 | * @var \Arcanedev\GeoLocation\Entities\Measures\Duration |
||
71 | */ |
||
72 | protected $duration; |
||
73 | |||
74 | /** |
||
75 | * The steps collection. |
||
76 | * |
||
77 | * @var \Arcanedev\GeoLocation\Google\Directions\Entities\StepCollection |
||
78 | */ |
||
79 | protected $steps; |
||
80 | |||
81 | /** |
||
82 | * The traffic speed entry. |
||
83 | * |
||
84 | * @var array |
||
85 | */ |
||
86 | protected $trafficSpeedEntry; |
||
87 | |||
88 | /** |
||
89 | * The via waypoint. |
||
90 | * |
||
91 | * @var array |
||
92 | */ |
||
93 | protected $viaWaypoint; |
||
94 | |||
95 | /* ----------------------------------------------------------------- |
||
96 | | Main Methods |
||
97 | | ----------------------------------------------------------------- |
||
98 | */ |
||
99 | |||
100 | /** |
||
101 | * Leg constructor. |
||
102 | * |
||
103 | * @param array $data |
||
104 | */ |
||
105 | 21 | public function __construct(array $data) |
|
121 | |||
122 | /* ----------------------------------------------------------------- |
||
123 | | Getters & Setters |
||
124 | | ----------------------------------------------------------------- |
||
125 | */ |
||
126 | /** |
||
127 | * @return string |
||
128 | */ |
||
129 | 9 | public function startAddress() |
|
133 | |||
134 | /** |
||
135 | * @return \Arcanedev\GeoLocation\Contracts\Entities\Coordinates\Position |
||
136 | */ |
||
137 | 9 | public function startLocation() |
|
141 | |||
142 | /** |
||
143 | * @return string |
||
144 | */ |
||
145 | 9 | public function endAddress() |
|
149 | |||
150 | /** |
||
151 | * @return \Arcanedev\GeoLocation\Contracts\Entities\Coordinates\Position |
||
152 | */ |
||
153 | 9 | public function endLocation() |
|
157 | |||
158 | /** |
||
159 | * Get the distance. |
||
160 | * |
||
161 | * @return \Arcanedev\GeoLocation\Entities\Measures\Distance |
||
162 | */ |
||
163 | 9 | public function distance() |
|
167 | |||
168 | /** |
||
169 | * Get the duration. |
||
170 | * |
||
171 | * @return \Arcanedev\GeoLocation\Entities\Measures\Duration |
||
172 | */ |
||
173 | 9 | public function duration() |
|
177 | |||
178 | /** |
||
179 | * Get the step collection. |
||
180 | * |
||
181 | * @return \Arcanedev\GeoLocation\Google\Directions\Entities\StepCollection |
||
182 | */ |
||
183 | 9 | public function steps() |
|
187 | |||
188 | /** |
||
189 | * Get the traffic speed entry. |
||
190 | * |
||
191 | * @return array |
||
192 | */ |
||
193 | 9 | public function trafficSpeedEntry() |
|
197 | |||
198 | /** |
||
199 | * Get the via waypoint. |
||
200 | * |
||
201 | * @return array |
||
202 | */ |
||
203 | 9 | public function viaWaypoint() |
|
207 | |||
208 | /* ----------------------------------------------------------------- |
||
209 | | Main Methods |
||
210 | | ----------------------------------------------------------------- |
||
211 | */ |
||
212 | |||
213 | /** |
||
214 | * Get the instance as an array. |
||
215 | * |
||
216 | * @return array |
||
217 | */ |
||
218 | 6 | public function toArray() |
|
232 | } |
||
233 |
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..