summaryrefslogtreecommitdiff
path: root/index.php
diff options
context:
space:
mode:
Diffstat (limited to 'index.php')
-rw-r--r--index.php19
1 files changed, 8 insertions, 11 deletions
diff --git a/index.php b/index.php
index 18f7eff..049c945 100644
--- a/index.php
+++ b/index.php
@@ -27,29 +27,26 @@ function getData($type, $route, $direction, $day) {
$timetables = json_decode(file_get_contents("timetable_full.json"), true);
switch ($type){
case "routes":
- $result = $timetables['timetables'];
+ return $timetables['timetables'];
break;
case "trips":
- $result = $timetables['timetables'][$route]['timetable'][$direction][$day]['trips'];
+ return $timetables['timetables'][$route]['timetable'][$direction][$day]['trips'];
break;
case "stoplist":
- $result = $timetables['timetables'][$route]['timetable'][$direction]['stops_list'];
+ return $timetables['timetables'][$route]['timetable'][$direction]['stops_list'];
break;
case "schedule":
- $result = $timetables['timetables'][$route];
+ return $timetables['timetables'][$route];
break;
case "meta":
- $result = $timetables['meta'];
+ return $timetables['meta'];
break;
case "service":
- $result = json_decode(file_get_contents("service_updates.json"), true);
+ return json_decode(file_get_contents("service_updates.json"), true);
default:
+ return False;
break;
- }
- if (!$result) {
- $result = False;
- }
- return $result;
+ }
}
$servUpdates = getData('service', false, false, false);