aboutsummaryrefslogtreecommitdiffhomepage
path: root/application/api
diff options
context:
space:
mode:
Diffstat (limited to 'application/api')
-rw-r--r--application/api/controllers/History.php4
-rw-r--r--application/api/controllers/Links.php4
2 files changed, 4 insertions, 4 deletions
diff --git a/application/api/controllers/History.php b/application/api/controllers/History.php
index 2ff9deaf..5cc453bf 100644
--- a/application/api/controllers/History.php
+++ b/application/api/controllers/History.php
@@ -36,7 +36,7 @@ class History extends ApiController
36 if (empty($offset)) { 36 if (empty($offset)) {
37 $offset = 0; 37 $offset = 0;
38 } 38 }
39 else if (ctype_digit($offset)) { 39 elseif (ctype_digit($offset)) {
40 $offset = (int) $offset; 40 $offset = (int) $offset;
41 } else { 41 } else {
42 throw new ApiBadParametersException('Invalid offset'); 42 throw new ApiBadParametersException('Invalid offset');
@@ -46,7 +46,7 @@ class History extends ApiController
46 $limit = $request->getParam('limit'); 46 $limit = $request->getParam('limit');
47 if (empty($limit)) { 47 if (empty($limit)) {
48 $limit = count($history); 48 $limit = count($history);
49 } else if (ctype_digit($limit)) { 49 } elseif (ctype_digit($limit)) {
50 $limit = (int) $limit; 50 $limit = (int) $limit;
51 } else { 51 } else {
52 throw new ApiBadParametersException('Invalid limit'); 52 throw new ApiBadParametersException('Invalid limit');
diff --git a/application/api/controllers/Links.php b/application/api/controllers/Links.php
index eb78dd26..3a9c0355 100644
--- a/application/api/controllers/Links.php
+++ b/application/api/controllers/Links.php
@@ -59,9 +59,9 @@ class Links extends ApiController
59 $limit = $request->getParam('limit'); 59 $limit = $request->getParam('limit');
60 if (empty($limit)) { 60 if (empty($limit)) {
61 $limit = self::$DEFAULT_LIMIT; 61 $limit = self::$DEFAULT_LIMIT;
62 } else if (ctype_digit($limit)) { 62 } elseif (ctype_digit($limit)) {
63 $limit = intval($limit); 63 $limit = intval($limit);
64 } else if ($limit === 'all') { 64 } elseif ($limit === 'all') {
65 $limit = count($links); 65 $limit = count($links);
66 } else { 66 } else {
67 throw new ApiBadParametersException('Invalid limit'); 67 throw new ApiBadParametersException('Invalid limit');