PSR: use elseif instead of else if

See https://www.php-fig.org/psr/psr-2/\#51-if-elseif-else
This commit is contained in:
ArthurHoaro 2018-02-28 22:34:40 +01:00
parent b70436373b
commit d2d4f993e1
8 changed files with 15 additions and 15 deletions
application/api/controllers

View file

@ -36,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');
@ -46,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');

View file

@ -59,9 +59,9 @@ class Links extends ApiController
$limit = $request->getParam('limit');
if (empty($limit)) {
$limit = self::$DEFAULT_LIMIT;
} else if (ctype_digit($limit)) {
} elseif (ctype_digit($limit)) {
$limit = intval($limit);
} else if ($limit === 'all') {
} elseif ($limit === 'all') {
$limit = count($links);
} else {
throw new ApiBadParametersException('Invalid limit');