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:
parent
b70436373b
commit
d2d4f993e1
8 changed files with 15 additions and 15 deletions
application/api/controllers
|
@ -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');
|
||||
|
|
|
@ -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');
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue