1 | <?php |
||
12 | class Sl implements PublicTransportSystemInterface |
||
13 | { |
||
14 | /** |
||
15 | * Sl Http API base uri. |
||
16 | */ |
||
17 | const BASE_URI = 'http://sl.se/api/'; |
||
18 | |||
19 | /** |
||
20 | * Search station API uri. |
||
21 | */ |
||
22 | const SEARCH_STATION_URI = 'TypeAhead/Find/'; |
||
23 | |||
24 | /** |
||
25 | * Departures API uri. |
||
26 | */ |
||
27 | const DEPARTURES_FROM_URI = 'sv/RealTime/GetDepartures/'; |
||
28 | |||
29 | /** |
||
30 | * Http client instance. |
||
31 | * |
||
32 | * @var \Sl\Contracts\HttpClientInterface |
||
33 | */ |
||
34 | private $httpClient; |
||
35 | |||
36 | /** |
||
37 | * Get Http client instance. |
||
38 | * |
||
39 | * @return \Sl\Contracts\HttpClientInterface |
||
40 | */ |
||
41 | 2 | public function httpClient() |
|
49 | |||
50 | /** |
||
51 | * Search for station. |
||
52 | * |
||
53 | * @param string $query |
||
54 | * |
||
55 | * @return \Sl\Contracts\Collections\StationCollectionInterface |
||
56 | */ |
||
57 | 1 | public function searchStation($query) |
|
63 | |||
64 | /** |
||
65 | * Get departures from station. |
||
66 | * |
||
67 | * @param \Sl\Contracts\Foundation\StationInterface $station |
||
68 | * |
||
69 | * @return \Sl\Contracts\Collections\DepartureCollectionInterface |
||
70 | */ |
||
71 | 1 | public function departuresFrom(StationInterface $station) |
|
77 | } |
||
78 |