Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/server.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristoph Wurst <christoph@winzerhof-wurst.at>2020-04-10 11:35:09 +0300
committerChristoph Wurst <christoph@winzerhof-wurst.at>2020-04-10 11:35:09 +0300
commit14c996d98256de958da367297c3313e0fa7ef9a8 (patch)
tree27074d5403b67cbaf59d7b7181481ebe70af5d9e /apps/files_sharing/lib/Controller
parentd6e17fb01777866674129a5883c03642f4bfd4a5 (diff)
Use elseif instead of else if
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
Diffstat (limited to 'apps/files_sharing/lib/Controller')
-rw-r--r--apps/files_sharing/lib/Controller/DeletedShareAPIController.php2
-rw-r--r--apps/files_sharing/lib/Controller/ShareAPIController.php36
-rw-r--r--apps/files_sharing/lib/Controller/ShareesAPIController.php4
3 files changed, 21 insertions, 21 deletions
diff --git a/apps/files_sharing/lib/Controller/DeletedShareAPIController.php b/apps/files_sharing/lib/Controller/DeletedShareAPIController.php
index b109a6282fa..fc58b5d1209 100644
--- a/apps/files_sharing/lib/Controller/DeletedShareAPIController.php
+++ b/apps/files_sharing/lib/Controller/DeletedShareAPIController.php
@@ -143,7 +143,7 @@ class DeletedShareAPIController extends OCSController {
$group = $this->groupManager->get($share->getSharedWith());
$result['share_with'] = $share->getSharedWith();
$result['share_with_displayname'] = $group !== null ? $group->getDisplayName() : $share->getSharedWith();
- } else if ($share->getShareType() === \OCP\Share::SHARE_TYPE_ROOM) {
+ } elseif ($share->getShareType() === \OCP\Share::SHARE_TYPE_ROOM) {
$result['share_with'] = $share->getSharedWith();
$result['share_with_displayname'] = '';
diff --git a/apps/files_sharing/lib/Controller/ShareAPIController.php b/apps/files_sharing/lib/Controller/ShareAPIController.php
index 833bc788687..40a9a387dde 100644
--- a/apps/files_sharing/lib/Controller/ShareAPIController.php
+++ b/apps/files_sharing/lib/Controller/ShareAPIController.php
@@ -218,11 +218,11 @@ class ShareAPIController extends OCSController {
$sharedWith = $this->userManager->get($share->getSharedWith());
$result['share_with'] = $share->getSharedWith();
$result['share_with_displayname'] = $sharedWith !== null ? $sharedWith->getDisplayName() : $share->getSharedWith();
- } else if ($share->getShareType() === Share::SHARE_TYPE_GROUP) {
+ } elseif ($share->getShareType() === Share::SHARE_TYPE_GROUP) {
$group = $this->groupManager->get($share->getSharedWith());
$result['share_with'] = $share->getSharedWith();
$result['share_with_displayname'] = $group !== null ? $group->getDisplayName() : $share->getSharedWith();
- } else if ($share->getShareType() === IShare::TYPE_LINK) {
+ } elseif ($share->getShareType() === IShare::TYPE_LINK) {
// "share_with" and "share_with_displayname" for passwords of link
// shares was deprecated in Nextcloud 15, use "password" instead.
@@ -235,17 +235,17 @@ class ShareAPIController extends OCSController {
$result['token'] = $share->getToken();
$result['url'] = $this->urlGenerator->linkToRouteAbsolute('files_sharing.sharecontroller.showShare', ['token' => $share->getToken()]);
- } else if ($share->getShareType() === Share::SHARE_TYPE_REMOTE || $share->getShareType() === Share::SHARE_TYPE_REMOTE_GROUP) {
+ } elseif ($share->getShareType() === Share::SHARE_TYPE_REMOTE || $share->getShareType() === Share::SHARE_TYPE_REMOTE_GROUP) {
$result['share_with'] = $share->getSharedWith();
$result['share_with_displayname'] = $this->getDisplayNameFromAddressBook($share->getSharedWith(), 'CLOUD');
$result['token'] = $share->getToken();
- } else if ($share->getShareType() === Share::SHARE_TYPE_EMAIL) {
+ } elseif ($share->getShareType() === Share::SHARE_TYPE_EMAIL) {
$result['share_with'] = $share->getSharedWith();
$result['password'] = $share->getPassword();
$result['send_password_by_talk'] = $share->getSendPasswordByTalk();
$result['share_with_displayname'] = $this->getDisplayNameFromAddressBook($share->getSharedWith(), 'EMAIL');
$result['token'] = $share->getToken();
- } else if ($share->getShareType() === Share::SHARE_TYPE_CIRCLE) {
+ } elseif ($share->getShareType() === Share::SHARE_TYPE_CIRCLE) {
// getSharedWith() returns either "name (type, owner)" or
// "name (type, owner) [id]", depending on the Circles app version.
$hasCircleId = (substr($share->getSharedWith(), -1) === ']');
@@ -264,7 +264,7 @@ class ShareAPIController extends OCSController {
$shareWithLength = -1;
}
$result['share_with'] = substr($share->getSharedWith(), $shareWithStart, $shareWithLength);
- } else if ($share->getShareType() === Share::SHARE_TYPE_ROOM) {
+ } elseif ($share->getShareType() === Share::SHARE_TYPE_ROOM) {
$result['share_with'] = $share->getSharedWith();
$result['share_with_displayname'] = '';
@@ -461,7 +461,7 @@ class ShareAPIController extends OCSController {
}
$share->setSharedWith($shareWith);
$share->setPermissions($permissions);
- } else if ($shareType === Share::SHARE_TYPE_GROUP) {
+ } elseif ($shareType === Share::SHARE_TYPE_GROUP) {
if (!$this->shareManager->allowGroupSharing()) {
throw new OCSNotFoundException($this->l->t('Group sharing is disabled by the administrator'));
}
@@ -472,7 +472,7 @@ class ShareAPIController extends OCSController {
}
$share->setSharedWith($shareWith);
$share->setPermissions($permissions);
- } else if ($shareType === Share::SHARE_TYPE_LINK
+ } elseif ($shareType === Share::SHARE_TYPE_LINK
|| $shareType === Share::SHARE_TYPE_EMAIL) {
// Can we even share links?
@@ -533,21 +533,21 @@ class ShareAPIController extends OCSController {
throw new OCSNotFoundException($this->l->t('Invalid date, date format must be YYYY-MM-DD'));
}
}
- } else if ($shareType === Share::SHARE_TYPE_REMOTE) {
+ } elseif ($shareType === Share::SHARE_TYPE_REMOTE) {
if (!$this->shareManager->outgoingServer2ServerSharesAllowed()) {
throw new OCSForbiddenException($this->l->t('Sharing %1$s failed because the back end does not allow shares from type %2$s', [$path->getPath(), $shareType]));
}
$share->setSharedWith($shareWith);
$share->setPermissions($permissions);
- } else if ($shareType === Share::SHARE_TYPE_REMOTE_GROUP) {
+ } elseif ($shareType === Share::SHARE_TYPE_REMOTE_GROUP) {
if (!$this->shareManager->outgoingServer2ServerGroupSharesAllowed()) {
throw new OCSForbiddenException($this->l->t('Sharing %1$s failed because the back end does not allow shares from type %2$s', [$path->getPath(), $shareType]));
}
$share->setSharedWith($shareWith);
$share->setPermissions($permissions);
- } else if ($shareType === Share::SHARE_TYPE_CIRCLE) {
+ } elseif ($shareType === Share::SHARE_TYPE_CIRCLE) {
if (!\OC::$server->getAppManager()->isEnabledForUser('circles') || !class_exists('\OCA\Circles\ShareByCircleProvider')) {
throw new OCSNotFoundException($this->l->t('You cannot share to a Circle if the app is not enabled'));
}
@@ -560,7 +560,7 @@ class ShareAPIController extends OCSController {
}
$share->setSharedWith($shareWith);
$share->setPermissions($permissions);
- } else if ($shareType === Share::SHARE_TYPE_ROOM) {
+ } elseif ($shareType === Share::SHARE_TYPE_ROOM) {
try {
$this->getRoomShareHelper()->createShare($share, $shareWith, $permissions, $expireDate);
} catch (QueryException $e) {
@@ -975,14 +975,14 @@ class ShareAPIController extends OCSController {
// Update hide download state
if ($hideDownload === 'true') {
$share->setHideDownload(true);
- } else if ($hideDownload === 'false') {
+ } elseif ($hideDownload === 'false') {
$share->setHideDownload(false);
}
$newPermissions = null;
if ($publicUpload === 'true') {
$newPermissions = Constants::PERMISSION_READ | Constants::PERMISSION_CREATE | Constants::PERMISSION_UPDATE | Constants::PERMISSION_DELETE;
- } else if ($publicUpload === 'false') {
+ } elseif ($publicUpload === 'false') {
$newPermissions = Constants::PERMISSION_READ;
}
@@ -1028,7 +1028,7 @@ class ShareAPIController extends OCSController {
if ($expireDate === '') {
$share->setExpirationDate(null);
- } else if ($expireDate !== null) {
+ } elseif ($expireDate !== null) {
try {
$expireDate = $this->parseDate($expireDate);
} catch (\Exception $e) {
@@ -1039,7 +1039,7 @@ class ShareAPIController extends OCSController {
if ($password === '') {
$share->setPassword(null);
- } else if ($password !== null) {
+ } elseif ($password !== null) {
$share->setPassword($password);
}
@@ -1054,7 +1054,7 @@ class ShareAPIController extends OCSController {
}
$share->setSendPasswordByTalk(true);
- } else if ($sendPasswordByTalk !== null) {
+ } elseif ($sendPasswordByTalk !== null) {
$share->setSendPasswordByTalk(false);
}
}
@@ -1068,7 +1068,7 @@ class ShareAPIController extends OCSController {
if ($expireDate === '') {
$share->setExpirationDate(null);
- } else if ($expireDate !== null) {
+ } elseif ($expireDate !== null) {
try {
$expireDate = $this->parseDate($expireDate);
} catch (\Exception $e) {
diff --git a/apps/files_sharing/lib/Controller/ShareesAPIController.php b/apps/files_sharing/lib/Controller/ShareesAPIController.php
index 898e57c1591..a8cd2196629 100644
--- a/apps/files_sharing/lib/Controller/ShareesAPIController.php
+++ b/apps/files_sharing/lib/Controller/ShareesAPIController.php
@@ -193,7 +193,7 @@ class ShareesAPIController extends OCSController {
if ($shareType !== null && is_array($shareType)) {
$shareTypes = array_intersect($shareTypes, $shareType);
- } else if (is_numeric($shareType)) {
+ } elseif (is_numeric($shareType)) {
$shareTypes = array_intersect($shareTypes, [(int) $shareType]);
}
sort($shareTypes);
@@ -362,7 +362,7 @@ class ShareesAPIController extends OCSController {
if (isset($_GET['shareType']) && is_array($_GET['shareType'])) {
$shareTypes = array_intersect($shareTypes, $_GET['shareType']);
sort($shareTypes);
- } else if (is_numeric($shareType)) {
+ } elseif (is_numeric($shareType)) {
$shareTypes = array_intersect($shareTypes, [(int) $shareType]);
sort($shareTypes);
}