Skip to content

Commit

Permalink
replaced with
Browse files Browse the repository at this point in the history
  • Loading branch information
Meezaan-ud-Din committed Feb 8, 2018
1 parent 647022b commit a0dd5b3
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 30 deletions.
4 changes: 2 additions & 2 deletions routes/asmaAlHusna/v1/asmaAlHusna.php
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@
* "data": "Please specify a valid number between 1 and 99."
* }
*/
$app->get('/asmaAlHusna', function (Request $request, Response $response) {
$this->get('/asmaAlHusna', function (Request $request, Response $response) {
$this->helper->logger->write();
$names = AsmaAlHusna::get();

Expand Down Expand Up @@ -107,7 +107,7 @@
* "data": "Please specify a valid number between 1 and 99."
* }
*/
$app->get('/asmaAlHusna/{no}', function (Request $request, Response $response) {
$this->get('/asmaAlHusna/{no}', function (Request $request, Response $response) {
$this->helper->logger->write();
$number = $request->getAttribute('no');
$number = explode(',', $number);
Expand Down
22 changes: 11 additions & 11 deletions routes/hijri/v1/hijriCalendar.php
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@
* ]
* }
*/
$app->get('/gToHCalendar/{month}/{year}', function (Request $request, Response $response) {
$this->get('/gToHCalendar/{month}/{year}', function (Request $request, Response $response) {
$this->helper->logger->write();
$cs = new HijriCalendarService();

Expand Down Expand Up @@ -146,7 +146,7 @@
* ]
* }
*/
$app->get('/hToGCalendar/{month}/{year}', function (Request $request, Response $response) {
$this->get('/hToGCalendar/{month}/{year}', function (Request $request, Response $response) {
$this->helper->logger->write();
$cs = new HijriCalendarService();

Expand Down Expand Up @@ -208,7 +208,7 @@
* }
* }
*/
$app->get('/gToH', function (Request $request, Response $response) {
$this->get('/gToH', function (Request $request, Response $response) {
$this->helper->logger->write();
$date = $request->getQueryParam('date') == '' || null ? date('d-m-Y', time()) : $request->getQueryParam('date');
$hs = new HijriCalendarService();
Expand Down Expand Up @@ -272,7 +272,7 @@
* }
* }
*/
$app->get('/hToG', function (Request $request, Response $response) {
$this->get('/hToG', function (Request $request, Response $response) {
$this->helper->logger->write();
$hs = new HijriCalendarService();
if ($request->getQueryParam('date') == '' || null) {
Expand All @@ -290,7 +290,7 @@
}
});

$app->get('/nextHijriHoliday', function (Request $request, Response $response) {
$this->get('/nextHijriHoliday', function (Request $request, Response $response) {
$this->helper->logger->write();
$hs = new HijriCalendarService();
$result = $hs->nextHijriHoliday();;
Expand All @@ -301,7 +301,7 @@
}
});

$app->get('/currentIslamicYear', function (Request $request, Response $response) {
$this->get('/currentIslamicYear', function (Request $request, Response $response) {
$this->helper->logger->write();
$hs = new HijriCalendarService();
$result = $hs->getCurrentIslamicYear();
Expand All @@ -312,7 +312,7 @@
}
});

$app->get('/currentIslamicMonth', function (Request $request, Response $response) {
$this->get('/currentIslamicMonth', function (Request $request, Response $response) {
$this->helper->logger->write();
$hs = new HijriCalendarService();
$result = $hs->getCurrentIslamicMonth();
Expand All @@ -323,7 +323,7 @@
}
});

$app->get('/islamicYearFromGregorianForRamadan/{year}', function (Request $request, Response $response) {
$this->get('/islamicYearFromGregorianForRamadan/{year}', function (Request $request, Response $response) {
$this->helper->logger->write();
$y = (int) $request->getAttribute('year');
$hs = new HijriCalendarService();
Expand All @@ -335,7 +335,7 @@
}
});

$app->get('/hijriHolidays/{day}/{month}', function (Request $request, Response $response) {
$this->get('/hijriHolidays/{day}/{month}', function (Request $request, Response $response) {
$this->helper->logger->write();
$d = (int) $request->getAttribute('day');
$m = (int) $request->getAttribute('month');
Expand All @@ -348,7 +348,7 @@
}
});

$app->get('/specialDays', function (Request $request, Response $response) {
$this->get('/specialDays', function (Request $request, Response $response) {
$this->helper->logger->write();
$hs = new HijriCalendarService();
$result = $hs->specialDays();
Expand All @@ -359,7 +359,7 @@
}
});

$app->get('/islamicMonths', function (Request $request, Response $response) {
$this->get('/islamicMonths', function (Request $request, Response $response) {
$this->helper->logger->write();
$hs = new HijriCalendarService();
$result = $hs->getIslamicMonths();
Expand Down
6 changes: 3 additions & 3 deletions routes/timings/v1/dateAndTime.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
* "data": "13:56"
* }
*/
$app->get('/currentTime', function (Request $request, Response $response) {
$this->get('/currentTime', function (Request $request, Response $response) {
$this->helper->logger->write();
$zone = $request->getQueryParam('zone');
if ($zone == '' || $zone == null || !Generic::isTimeZoneValid($zone)) {
Expand Down Expand Up @@ -58,7 +58,7 @@
* "data": "23-08-2017"
* }
*/
$app->get('/currentDate', function (Request $request, Response $response) {
$this->get('/currentDate', function (Request $request, Response $response) {
$this->helper->logger->write();
$zone = $request->getQueryParam('zone');
if ($zone == '' || $zone == null || !Generic::isTimeZoneValid($zone)) {
Expand Down Expand Up @@ -90,7 +90,7 @@
* "data": "1503495668"
* }
*/
$app->get('/currentTimestamp', function (Request $request, Response $response) {
$this->get('/currentTimestamp', function (Request $request, Response $response) {
$zone = $request->getQueryParam('zone');
if ($zone == '' || $zone == null || !Generic::isTimeZoneValid($zone)) {
return $response->withJson(ApiResponse::build('Please specify a valid timezone. Example: Europe/London', 400, 'Bad Request'), 400);
Expand Down
28 changes: 14 additions & 14 deletions routes/timings/v1/prayerTimes.php
Original file line number Diff line number Diff line change
Expand Up @@ -49,14 +49,14 @@
* }
*
**/
$app->get('/methods', function (Request $request, Response $response) {
$this->get('/methods', function (Request $request, Response $response) {
$this->helper->logger->write();
$pt = new PrayerTimes();

return $response->withJson(ApiResponse::build($pt->getMethods(), 200, 'OK'), 200);
});

$app->get('/nextPrayerByAddress', function (Request $request, Response $response) {
$this->get('/nextPrayerByAddress', function (Request $request, Response $response) {
$this->helper->logger->write();
$method = ClassMapper::method(ApiRequest::method($request->getQueryParam('method')));
$school = ClassMapper::school(ApiRequest::school($request->getQueryParam('school')));
Expand Down Expand Up @@ -86,7 +86,7 @@
}
});

$app->get('/nextPrayerByAddress/{timestamp}', function (Request $request, Response $response) {
$this->get('/nextPrayerByAddress/{timestamp}', function (Request $request, Response $response) {
$this->helper->logger->write();
$timestamp = ApiRequest::time($request->getAttribute('timestamp'));
$method = ClassMapper::method(ApiRequest::method($request->getQueryParam('method')));
Expand Down Expand Up @@ -203,7 +203,7 @@
* }
* }
*/
$app->get('/timings', function (Request $request, Response $response) {
$this->get('/timings', function (Request $request, Response $response) {
$this->helper->logger->write();
$method = ClassMapper::method(ApiRequest::method($request->getQueryParam('method')));
$school = ClassMapper::school(ApiRequest::school($request->getQueryParam('school')));
Expand Down Expand Up @@ -232,7 +232,7 @@
}
});

$app->get('/timings/{timestamp}', function (Request $request, Response $response) {
$this->get('/timings/{timestamp}', function (Request $request, Response $response) {
$this->helper->logger->write();
$timestamp = ApiRequest::time($request->getAttribute('timestamp'));
$method = ClassMapper::method(ApiRequest::method($request->getQueryParam('method')));
Expand Down Expand Up @@ -347,7 +347,7 @@
* }
* }
*/
$app->get('/timingsByAddress', function (Request $request, Response $response) {
$this->get('/timingsByAddress', function (Request $request, Response $response) {
$this->helper->logger->write();
$method = ClassMapper::method(ApiRequest::method($request->getQueryParam('method')));
$school = ClassMapper::school(ApiRequest::school($request->getQueryParam('school')));
Expand Down Expand Up @@ -376,7 +376,7 @@
}
});

$app->get('/timingsByAddress/{timestamp}', function (Request $request, Response $response) {
$this->get('/timingsByAddress/{timestamp}', function (Request $request, Response $response) {
$this->helper->logger->write();
$timestamp = ApiRequest::time($request->getAttribute('timestamp'));
$method = ClassMapper::method(ApiRequest::method($request->getQueryParam('method')));
Expand Down Expand Up @@ -492,7 +492,7 @@
* }
* }
*/
$app->get('/timingsByCity', function (Request $request, Response $response) {
$this->get('/timingsByCity', function (Request $request, Response $response) {
$this->helper->logger->write();
$method = ClassMapper::method(ApiRequest::method($request->getQueryParam('method')));
$school = ClassMapper::school(ApiRequest::school($request->getQueryParam('school')));
Expand Down Expand Up @@ -522,7 +522,7 @@
}
});

$app->get('/timingsByCity/{timestamp}', function (Request $request, Response $response) {
$this->get('/timingsByCity/{timestamp}', function (Request $request, Response $response) {
$this->helper->logger->write();
$timestamp = ApiRequest::time($request->getAttribute('timestamp'));
$method = ClassMapper::method(ApiRequest::method($request->getQueryParam('method')));
Expand Down Expand Up @@ -687,7 +687,7 @@
* ]
* }
*/
$app->get('/calendar', function (Request $request, Response $response) {
$this->get('/calendar', function (Request $request, Response $response) {
$this->helper->logger->write();
$method = ClassMapper::method(ApiRequest::method($request->getQueryParam('method')));
$school = ClassMapper::school(ApiRequest::school($request->getQueryParam('school')));
Expand Down Expand Up @@ -855,7 +855,7 @@
* ]
* }
*/
$app->get('/calendarByAddress', function (Request $request, Response $response) {
$this->get('/calendarByAddress', function (Request $request, Response $response) {
$this->helper->logger->write();
$method = ClassMapper::method(ApiRequest::method($request->getQueryParam('method')));
$school = ClassMapper::school(ApiRequest::school($request->getQueryParam('school')));
Expand Down Expand Up @@ -1020,7 +1020,7 @@
* ]
* }
*/
$app->get('/calendarByCity', function (Request $request, Response $response) {
$this->get('/calendarByCity', function (Request $request, Response $response) {
$this->helper->logger->write();
$method = ClassMapper::method(ApiRequest::method($request->getQueryParam('method')));
$school = ClassMapper::school(ApiRequest::school($request->getQueryParam('school')));
Expand Down Expand Up @@ -1080,7 +1080,7 @@
* }
*
**/
$app->get('/cityInfo', function (Request $request, Response $response) {
$this->get('/cityInfo', function (Request $request, Response $response) {
$this->helper->logger->write();
$city = $request->getQueryParam('city');
$country = $request->getQueryParam('country');
Expand Down Expand Up @@ -1118,7 +1118,7 @@
* }
*
**/
$app->get('/addressInfo', function (Request $request, Response $response) {
$this->get('/addressInfo', function (Request $request, Response $response) {
$this->helper->logger->write();
$address = $request->getQueryParam('address');
$result = $this->model->locations->getAddressCoOrdinatesAndZone($address);
Expand Down

0 comments on commit a0dd5b3

Please sign in to comment.