aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--apps/files_external/lib/Controller/AjaxController.php4
-rw-r--r--apps/files_sharing/lib/Controller/ShareController.php2
-rw-r--r--apps/user_ldap/lib/Jobs/CleanUp.php2
-rw-r--r--lib/private/Encryption/Util.php2
-rw-r--r--lib/private/Files/Storage/Wrapper/Encryption.php4
-rw-r--r--lib/private/Memcache/Redis.php4
-rw-r--r--lib/private/Settings/Admin/Sharing.php2
-rw-r--r--lib/private/Share/Helper.php2
-rw-r--r--lib/private/Share/Share.php8
-rw-r--r--lib/private/SubAdmin.php4
-rw-r--r--lib/private/Template/JSConfigHelper.php2
-rw-r--r--lib/private/legacy/util.php4
-rw-r--r--settings/Controller/AppSettingsController.php2
13 files changed, 19 insertions, 23 deletions
diff --git a/apps/files_external/lib/Controller/AjaxController.php b/apps/files_external/lib/Controller/AjaxController.php
index 9c2953851f5..66cbcae3e8f 100644
--- a/apps/files_external/lib/Controller/AjaxController.php
+++ b/apps/files_external/lib/Controller/AjaxController.php
@@ -110,9 +110,7 @@ class AjaxController extends Controller {
$currentUser = $this->userSession->getUser();
// Non-admins can only edit their own credentials
- $allowedToEdit = (
- $this->groupManager->isAdmin($currentUser->getUID()) || $currentUser->getUID() === $uid
- ) ? true : false;
+ $allowedToEdit = ($this->groupManager->isAdmin($currentUser->getUID()) || $currentUser->getUID() === $uid);
if ($allowedToEdit) {
$this->globalAuth->saveAuth($uid, $user, $password);
diff --git a/apps/files_sharing/lib/Controller/ShareController.php b/apps/files_sharing/lib/Controller/ShareController.php
index c51bc1a75dd..fdd69987658 100644
--- a/apps/files_sharing/lib/Controller/ShareController.php
+++ b/apps/files_sharing/lib/Controller/ShareController.php
@@ -348,7 +348,7 @@ class ShareController extends Controller {
$freeSpace = (INF > 0) ? INF: PHP_INT_MAX; // work around https://bugs.php.net/bug.php?id=69188
}
- $hideFileList = $share->getPermissions() & \OCP\Constants::PERMISSION_READ ? false : true;
+ $hideFileList = !($share->getPermissions() & \OCP\Constants::PERMISSION_READ);
$maxUploadFilesize = $freeSpace;
$folder = new Template('files', 'list', '');
diff --git a/apps/user_ldap/lib/Jobs/CleanUp.php b/apps/user_ldap/lib/Jobs/CleanUp.php
index 14682c65ce1..df7d888a902 100644
--- a/apps/user_ldap/lib/Jobs/CleanUp.php
+++ b/apps/user_ldap/lib/Jobs/CleanUp.php
@@ -156,7 +156,7 @@ class CleanUp extends TimedJob {
* @return bool
*/
public function isOffsetResetNecessary($resultCount) {
- return ($resultCount < $this->limit) ? true : false;
+ return $resultCount < $this->limit;
}
/**
diff --git a/lib/private/Encryption/Util.php b/lib/private/Encryption/Util.php
index 047ef1626df..fc0adbbd47b 100644
--- a/lib/private/Encryption/Util.php
+++ b/lib/private/Encryption/Util.php
@@ -384,7 +384,7 @@ class Util {
public function recoveryEnabled($uid) {
$enabled = $this->config->getUserValue($uid, 'encryption', 'recovery_enabled', '0');
- return ($enabled === '1') ? true : false;
+ return $enabled === '1';
}
/**
diff --git a/lib/private/Files/Storage/Wrapper/Encryption.php b/lib/private/Files/Storage/Wrapper/Encryption.php
index d443ccfd49b..e40a4830953 100644
--- a/lib/private/Files/Storage/Wrapper/Encryption.php
+++ b/lib/private/Files/Storage/Wrapper/Encryption.php
@@ -379,7 +379,7 @@ class Encryption extends Wrapper {
$shouldEncrypt = false;
$encryptionModule = null;
$header = $this->getHeader($path);
- $signed = (isset($header['signed']) && $header['signed'] === 'true') ? true : false;
+ $signed = isset($header['signed']) && $header['signed'] === 'true';
$fullPath = $this->getFullPath($path);
$encryptionModuleId = $this->util->getEncryptionModuleId($header);
@@ -544,7 +544,7 @@ class Encryption extends Wrapper {
return 0;
}
- $signed = (isset($header['signed']) && $header['signed'] === 'true') ? true : false;
+ $signed = isset($header['signed']) && $header['signed'] === 'true';
$unencryptedBlockSize = $encryptionModule->getUnencryptedBlockSize($signed);
// calculate last chunk nr
diff --git a/lib/private/Memcache/Redis.php b/lib/private/Memcache/Redis.php
index 9cc61114b00..adf3c5050bd 100644
--- a/lib/private/Memcache/Redis.php
+++ b/lib/private/Memcache/Redis.php
@@ -145,7 +145,7 @@ class Redis extends Cache implements IMemcacheTTL {
$result = self::$cache->multi()
->set($this->getNameSpace() . $key, $new)
->exec();
- return ($result === false) ? false : true;
+ return $result !== false;
}
self::$cache->unwatch();
return false;
@@ -164,7 +164,7 @@ class Redis extends Cache implements IMemcacheTTL {
$result = self::$cache->multi()
->del($this->getNameSpace() . $key)
->exec();
- return ($result === false) ? false : true;
+ return $result !== false;
}
self::$cache->unwatch();
return false;
diff --git a/lib/private/Settings/Admin/Sharing.php b/lib/private/Settings/Admin/Sharing.php
index a99ba453d67..dbdacf78dab 100644
--- a/lib/private/Settings/Admin/Sharing.php
+++ b/lib/private/Settings/Admin/Sharing.php
@@ -64,7 +64,7 @@ class Sharing implements ISettings {
'shareDefaultExpireDateSet' => $this->config->getAppValue('core', 'shareapi_default_expire_date', 'no'),
'shareExpireAfterNDays' => $this->config->getAppValue('core', 'shareapi_expire_after_n_days', '7'),
'shareEnforceExpireDate' => $this->config->getAppValue('core', 'shareapi_enforce_expire_date', 'no'),
- 'shareExcludeGroups' => $this->config->getAppValue('core', 'shareapi_exclude_groups', 'no') === 'yes' ? true : false,
+ 'shareExcludeGroups' => $this->config->getAppValue('core', 'shareapi_exclude_groups', 'no') === 'yes',
'shareExcludedGroupsList' => $excludeGroupsList,
'publicShareDisclaimerText' => $this->config->getAppValue('core', 'shareapi_public_link_disclaimertext', null),
'enableLinkPasswordByDefault' => $this->config->getAppValue('core', 'shareapi_enable_link_password_by_default', 'no'),
diff --git a/lib/private/Share/Helper.php b/lib/private/Share/Helper.php
index a1a56077d40..2eba67004dd 100644
--- a/lib/private/Share/Helper.php
+++ b/lib/private/Share/Helper.php
@@ -169,7 +169,7 @@ class Helper extends \OC\Share\Constants {
$enforceExpireDate = $config->getAppValue('core', 'shareapi_enforce_expire_date', 'no');
$defaultExpireSettings['defaultExpireDateSet'] = true;
$defaultExpireSettings['expireAfterDays'] = (int)($config->getAppValue('core', 'shareapi_expire_after_n_days', '7'));
- $defaultExpireSettings['enforceExpireDate'] = $enforceExpireDate === 'yes' ? true : false;
+ $defaultExpireSettings['enforceExpireDate'] = $enforceExpireDate === 'yes';
}
return $defaultExpireSettings;
diff --git a/lib/private/Share/Share.php b/lib/private/Share/Share.php
index 8812399c812..35d84307548 100644
--- a/lib/private/Share/Share.php
+++ b/lib/private/Share/Share.php
@@ -1416,7 +1416,7 @@ class Share extends Constants {
*/
protected static function groupItems($items, $itemType) {
- $fileSharing = ($itemType === 'file' || $itemType === 'folder') ? true : false;
+ $fileSharing = $itemType === 'file' || $itemType === 'folder';
$result = array();
@@ -2070,7 +2070,7 @@ class Share extends Constants {
*/
public static function shareWithGroupMembersOnly() {
$value = \OC::$server->getConfig()->getAppValue('core', 'shareapi_only_share_with_group_members', 'no');
- return ($value === 'yes') ? true : false;
+ return $value === 'yes';
}
/**
@@ -2078,7 +2078,7 @@ class Share extends Constants {
*/
public static function isDefaultExpireDateEnabled() {
$defaultExpireDateEnabled = \OC::$server->getConfig()->getAppValue('core', 'shareapi_default_expire_date', 'no');
- return ($defaultExpireDateEnabled === "yes") ? true : false;
+ return $defaultExpireDateEnabled === 'yes';
}
/**
@@ -2119,7 +2119,7 @@ class Share extends Constants {
*/
public static function enforcePassword(IConfig $config) {
$enforcePassword = $config->getAppValue('core', 'shareapi_enforce_links_password', 'no');
- return ($enforcePassword === "yes") ? true : false;
+ return $enforcePassword === 'yes';
}
/**
diff --git a/lib/private/SubAdmin.php b/lib/private/SubAdmin.php
index d92c8d01605..cd16d07e43d 100644
--- a/lib/private/SubAdmin.php
+++ b/lib/private/SubAdmin.php
@@ -230,9 +230,7 @@ class SubAdmin extends PublicEmitter {
$isSubAdmin = $result->fetch();
$result->closeCursor();
- $result = $isSubAdmin === false ? false : true;
-
- return $result;
+ return $isSubAdmin !== false;
}
/**
diff --git a/lib/private/Template/JSConfigHelper.php b/lib/private/Template/JSConfigHelper.php
index 65068973e40..ab52704d1e2 100644
--- a/lib/private/Template/JSConfigHelper.php
+++ b/lib/private/Template/JSConfigHelper.php
@@ -122,7 +122,7 @@ class JSConfigHelper {
$enableLinkPasswordByDefault = $this->config->getAppValue('core', 'shareapi_enable_link_password_by_default', 'no');
- $enableLinkPasswordByDefault = ($enableLinkPasswordByDefault === 'yes') ? true : false;
+ $enableLinkPasswordByDefault = $enableLinkPasswordByDefault === 'yes';
$defaultExpireDateEnabled = $this->config->getAppValue('core', 'shareapi_default_expire_date', 'no') === 'yes';
$defaultExpireDate = $enforceDefaultExpireDate = null;
if ($defaultExpireDateEnabled) {
diff --git a/lib/private/legacy/util.php b/lib/private/legacy/util.php
index 776a879e731..efa488b434d 100644
--- a/lib/private/legacy/util.php
+++ b/lib/private/legacy/util.php
@@ -301,7 +301,7 @@ class OC_Util {
*/
public static function isPublicLinkPasswordRequired() {
$enforcePassword = \OC::$server->getConfig()->getAppValue('core', 'shareapi_enforce_links_password', 'no');
- return ($enforcePassword === 'yes') ? true : false;
+ return $enforcePassword === 'yes';
}
/**
@@ -344,7 +344,7 @@ class OC_Util {
$enforceDefaultExpireDate = false;
if ($isDefaultExpireDateEnabled === 'yes') {
$value = \OC::$server->getConfig()->getAppValue('core', 'shareapi_enforce_expire_date', 'no');
- $enforceDefaultExpireDate = ($value === 'yes') ? true : false;
+ $enforceDefaultExpireDate = $value === 'yes';
}
return $enforceDefaultExpireDate;
diff --git a/settings/Controller/AppSettingsController.php b/settings/Controller/AppSettingsController.php
index f2a92b52f6d..cd34edf567c 100644
--- a/settings/Controller/AppSettingsController.php
+++ b/settings/Controller/AppSettingsController.php
@@ -205,7 +205,7 @@ class AppSettingsController extends Controller {
$nextCloudVersionDependencies['nextcloud']['@attributes']['max-version'] = $nextCloudVersion->getMaximumVersion();
}
$phpVersion = $versionParser->getVersion($app['releases'][0]['rawPhpVersionSpec']);
- $existsLocally = (\OC_App::getAppPath($app['id']) !== false) ? true : false;
+ $existsLocally = \OC_App::getAppPath($app['id']) !== false;
$phpDependencies = [];
if($phpVersion->getMinimumVersion() !== '') {
$phpDependencies['php']['@attributes']['min-version'] = $phpVersion->getMinimumVersion();