]> git.immae.eu Git - github/shaarli/Shaarli.git/blobdiff - application/api/controllers/History.php
PSR: use elseif instead of else if
[github/shaarli/Shaarli.git] / application / api / controllers / History.php
index da034eb226eceb276d2c5e65043aceedff0a15d8..5cc453bfadd1decd5649d5cceab43ab342140b53 100644 (file)
@@ -29,7 +29,6 @@ class History extends ApiController
     public function getHistory($request, $response)
     {
         $history = $this->history->getHistory();
-        $history = array_reverse($history);
 
         // Return history operations from the {offset}th, starting from {since}.
         $since = \DateTime::createFromFormat(\DateTime::ATOM, $request->getParam('since'));
@@ -37,7 +36,7 @@ class History extends ApiController
         if (empty($offset)) {
             $offset = 0;
         }
-        else if (ctype_digit($offset)) {
+        elseif (ctype_digit($offset)) {
             $offset = (int) $offset;
         } else {
             throw new ApiBadParametersException('Invalid offset');
@@ -47,7 +46,7 @@ class History extends ApiController
         $limit = $request->getParam('limit');
         if (empty($limit)) {
             $limit = count($history);
-        } else if (ctype_digit($limit)) {
+        } elseif (ctype_digit($limit)) {
             $limit = (int) $limit;
         } else {
             throw new ApiBadParametersException('Invalid limit');