if (is_file($file) && !is_writeable($file)) {
// The datastore exists but is not writeable
throw new IOException($file);
- } else if (!is_file($file) && !is_writeable(dirname($file))) {
+ } elseif (!is_file($file) && !is_writeable(dirname($file))) {
// The datastore does not exist and its parent directory is not writeable
throw new IOException(dirname($file));
}
foreach ($this->links as $key => $value) {
if ($value['private'] && $visibility === 'private') {
$out[$key] = $value;
- } else if (! $value['private'] && $visibility === 'public') {
+ } elseif (! $value['private'] && $visibility === 'public') {
$out[$key] = $value;
}
}
if ($visibility !== 'all') {
if (! $link['private'] && $visibility === 'private') {
continue;
- } else if ($link['private'] && $visibility === 'public') {
+ } elseif ($link['private'] && $visibility === 'public') {
continue;
}
}
if ($visibility !== 'all') {
if (! $link['private'] && $visibility === 'private') {
continue;
- } else if ($link['private'] && $visibility === 'public') {
+ } elseif ($link['private'] && $visibility === 'public') {
continue;
}
}
if ($visibility !== 'all') {
if (! $link['private'] && $visibility === 'private') {
continue;
- } else if ($link['private'] && $visibility === 'public') {
+ } elseif ($link['private'] && $visibility === 'public') {
continue;
}
}
if (empty($post['privacy']) || $post['privacy'] == 'default') {
// use value from the imported file
$private = $bkm['pub'] == '1' ? 0 : 1;
- } else if ($post['privacy'] == 'private') {
+ } elseif ($post['privacy'] == 'private') {
// all imported links are private
$private = 1;
- } else if ($post['privacy'] == 'public') {
+ } elseif ($post['privacy'] == 'public') {
// all imported links are public
$private = 0;
}
// Protocol not allowed: we remove it and replace it with http
if ($protocol === 1 && ! in_array($match[1], $protocols)) {
$url = str_replace($match[0], 'http://', $url);
- } else if ($protocol !== 1) {
+ } elseif ($protocol !== 1) {
$url = 'http://' . $url;
}
return $url;
if (empty($offset)) {
$offset = 0;
}
- else if (ctype_digit($offset)) {
+ elseif (ctype_digit($offset)) {
$offset = (int) $offset;
} else {
throw new ApiBadParametersException('Invalid offset');
$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');
$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');
if (empty($params['searchtags'])) {
$params['searchtags'] = trim($_GET['addtag']);
}
- else if ($addtag) {
+ elseif ($addtag) {
$params['searchtags'] = trim($params['searchtags']).' '.trim($_GET['addtag']);
}
} else {
unset($_SESSION['visibility']);
}
- } else if ($_GET['visibility'] === 'public') {
+ } elseif ($_GET['visibility'] === 'public') {
if (empty($_SESSION['visibility']) || $_SESSION['visibility'] !== 'public') {
// See only public links
$_SESSION['visibility'] = 'public';
{
if (isset($data['_PAGE_']) && $data['_PAGE_'] == 'test') {
$data[1] = 'page test';
- } else if (isset($data['_LOGGEDIN_']) && $data['_LOGGEDIN_'] === true) {
+ } elseif (isset($data['_LOGGEDIN_']) && $data['_LOGGEDIN_'] === true) {
$data[1] = 'loggedin';
} else {
$data[1] = $data[0];