diff options
author | Morris Jobke <hey@morrisjobke.de> | 2018-01-26 23:46:40 +0100 |
---|---|---|
committer | Morris Jobke <hey@morrisjobke.de> | 2018-01-26 23:46:40 +0100 |
commit | a661f043e1a8764cb7c795f50df77b830d3e352b (patch) | |
tree | 77a06311ffb5e59c86def06bbb618335da1f2b6a /lib/private | |
parent | 9be6050cc42c2760bd2276942a24ba3db288b551 (diff) | |
download | nextcloud-server-a661f043e1a8764cb7c795f50df77b830d3e352b.tar.gz nextcloud-server-a661f043e1a8764cb7c795f50df77b830d3e352b.zip |
Remove unneeded semicolon and parentheses
Signed-off-by: Morris Jobke <hey@morrisjobke.de>
Diffstat (limited to 'lib/private')
24 files changed, 33 insertions, 33 deletions
diff --git a/lib/private/DB/SQLiteSessionInit.php b/lib/private/DB/SQLiteSessionInit.php index 0e947b9918e..635a5d98a9e 100644 --- a/lib/private/DB/SQLiteSessionInit.php +++ b/lib/private/DB/SQLiteSessionInit.php @@ -55,7 +55,7 @@ class SQLiteSessionInit implements EventSubscriber { * @return void */ public function postConnect(ConnectionEventArgs $args) { - $sensitive = ($this->caseSensitiveLike) ? 'true' : 'false'; + $sensitive = $this->caseSensitiveLike ? 'true' : 'false'; $args->getConnection()->executeUpdate('PRAGMA case_sensitive_like = ' . $sensitive); $args->getConnection()->executeUpdate('PRAGMA journal_mode = ' . $this->journalMode); /** @var \PDO $pdo */ diff --git a/lib/private/Files/Cache/Cache.php b/lib/private/Files/Cache/Cache.php index 428f52fd9ef..007bccf0a54 100644 --- a/lib/private/Files/Cache/Cache.php +++ b/lib/private/Files/Cache/Cache.php @@ -206,7 +206,7 @@ class Cache implements ICache { $result = $this->connection->executeQuery($sql, [$fileId]); $files = $result->fetchAll(); return array_map(function (array $data) { - return self::cacheEntryFromData($data, $this->mimetypeLoader);; + return self::cacheEntryFromData($data, $this->mimetypeLoader); }, $files); } return []; diff --git a/lib/private/Files/Cache/Scanner.php b/lib/private/Files/Cache/Scanner.php index 28a3d11ffa9..22d82a36c4d 100644 --- a/lib/private/Files/Cache/Scanner.php +++ b/lib/private/Files/Cache/Scanner.php @@ -428,7 +428,7 @@ class Scanner extends BasicEmitter implements IScanner { $exceptionOccurred = false; $childQueue = []; foreach ($newChildren as $file) { - $child = ($path) ? $path . '/' . $file : $file; + $child = $path ? $path . '/' . $file : $file; try { $existingData = isset($existingChildren[$file]) ? $existingChildren[$file] : null; $data = $this->scanFile($child, $reuse, $folderId, $existingData, $lock); @@ -467,7 +467,7 @@ class Scanner extends BasicEmitter implements IScanner { } $removedChildren = \array_diff(array_keys($existingChildren), $newChildren); foreach ($removedChildren as $childName) { - $child = ($path) ? $path . '/' . $childName : $childName; + $child = $path ? $path . '/' . $childName : $childName; $this->removeFromCache($child); } if ($this->useTransactions) { diff --git a/lib/private/Files/Cache/Storage.php b/lib/private/Files/Cache/Storage.php index b2bb8fd0078..794c4872c93 100644 --- a/lib/private/Files/Cache/Storage.php +++ b/lib/private/Files/Cache/Storage.php @@ -154,7 +154,7 @@ class Storage { public function getAvailability() { if ($row = self::getStorageById($this->storageId)) { return [ - 'available' => ((int)$row['available'] === 1), + 'available' => (int)$row['available'] === 1, 'last_checked' => $row['last_checked'] ]; } else { diff --git a/lib/private/Files/ObjectStore/S3ConnectionTrait.php b/lib/private/Files/ObjectStore/S3ConnectionTrait.php index 7e70cc846ef..188012b7c1f 100644 --- a/lib/private/Files/ObjectStore/S3ConnectionTrait.php +++ b/lib/private/Files/ObjectStore/S3ConnectionTrait.php @@ -55,7 +55,7 @@ trait S3ConnectionTrait { $this->test = isset($params['test']); $this->bucket = $params['bucket']; - $this->timeout = (!isset($params['timeout'])) ? 15 : $params['timeout']; + $this->timeout = !isset($params['timeout']) ? 15 : $params['timeout']; $params['region'] = empty($params['region']) ? 'eu-west-1' : $params['region']; $params['hostname'] = empty($params['hostname']) ? 's3.' . $params['region'] . '.amazonaws.com' : $params['hostname']; if (!isset($params['port']) || $params['port'] === '') { diff --git a/lib/private/Files/Stream/Encryption.php b/lib/private/Files/Stream/Encryption.php index d76ba85aa62..05107652c91 100644 --- a/lib/private/Files/Stream/Encryption.php +++ b/lib/private/Files/Stream/Encryption.php @@ -329,7 +329,7 @@ class Encryption extends Wrapper { $resultFseek = $this->parentStreamSeek($positionInFile); // only allow writes on seekable streams, or at the end of the encrypted stream - if (!($this->readOnly) && ($resultFseek || $positionInFile === $this->size)) { + if (!$this->readOnly && ($resultFseek || $positionInFile === $this->size)) { // switch the writeFlag so flush() will write the block $this->writeFlag = true; diff --git a/lib/private/Files/View.php b/lib/private/Files/View.php index 3ab3ed89e6b..aaf14b4d7e0 100644 --- a/lib/private/Files/View.php +++ b/lib/private/Files/View.php @@ -682,7 +682,7 @@ class View { return false; } } else { - $hooks = ($this->file_exists($path)) ? array('update', 'write') : array('create', 'write'); + $hooks = $this->file_exists($path) ? array('update', 'write') : array('create', 'write'); return $this->basicOperation('file_put_contents', $path, $hooks, $data); } } @@ -1245,7 +1245,7 @@ class View { private function runHooks($hooks, $path, $post = false) { $relativePath = $path; $path = $this->getHookPath($path); - $prefix = ($post) ? 'post_' : ''; + $prefix = $post ? 'post_' : ''; $run = true; if ($this->shouldEmitHooks($relativePath)) { foreach ($hooks as $hook) { diff --git a/lib/private/Installer.php b/lib/private/Installer.php index ea8ee5f01e5..d150e48fd87 100644 --- a/lib/private/Installer.php +++ b/lib/private/Installer.php @@ -149,7 +149,7 @@ class Installer { } //run appinfo/install.php - if((!isset($data['noinstall']) or $data['noinstall']==false)) { + if(!isset($data['noinstall']) or $data['noinstall']==false) { self::includeAppScript($basedir . '/appinfo/install.php'); } diff --git a/lib/private/Log/File.php b/lib/private/Log/File.php index 290f7897c9d..ba5027251d7 100644 --- a/lib/private/Log/File.php +++ b/lib/private/Log/File.php @@ -101,7 +101,7 @@ class File { $url = ($request->getRequestUri() !== '') ? $request->getRequestUri() : '--'; $method = is_string($request->getMethod()) ? $request->getMethod() : '--'; if($config->getValue('installed', false)) { - $user = (\OC_User::getUser()) ? \OC_User::getUser() : '--'; + $user = \OC_User::getUser() ? \OC_User::getUser() : '--'; } else { $user = '--'; } diff --git a/lib/private/Memcache/ArrayCache.php b/lib/private/Memcache/ArrayCache.php index 2f63ba371aa..e8ec221524d 100644 --- a/lib/private/Memcache/ArrayCache.php +++ b/lib/private/Memcache/ArrayCache.php @@ -113,7 +113,7 @@ class ArrayCache extends Cache implements IMemcache { return $oldValue + $step; } else { $success = $this->add($key, $step); - return ($success) ? $step : false; + return $success ? $step : false; } } diff --git a/lib/private/Preview/TXT.php b/lib/private/Preview/TXT.php index 88c6e87f38e..2925e5bd537 100644 --- a/lib/private/Preview/TXT.php +++ b/lib/private/Preview/TXT.php @@ -60,7 +60,7 @@ class TXT extends Provider { $lines = preg_split("/\r\n|\n|\r/", $content); - $fontSize = ($maxX) ? (int) ((5 / 32) * $maxX) : 5; //5px + $fontSize = $maxX ? (int) ((5 / 32) * $maxX) : 5; //5px $lineSize = ceil($fontSize * 1.25); $image = imagecreate($maxX, $maxY); diff --git a/lib/private/PreviewManager.php b/lib/private/PreviewManager.php index 46ef8862e6b..f9c96aa6e7a 100644 --- a/lib/private/PreviewManager.php +++ b/lib/private/PreviewManager.php @@ -411,7 +411,7 @@ class PreviewManager implements IPreview { // Video requires avconv or ffmpeg if (in_array('OC\Preview\Movie', $this->getEnabledDefaultProvider())) { $avconvBinary = \OC_Helper::findBinaryPath('avconv'); - $ffmpegBinary = ($avconvBinary) ? null : \OC_Helper::findBinaryPath('ffmpeg'); + $ffmpegBinary = $avconvBinary ? null : \OC_Helper::findBinaryPath('ffmpeg'); if ($avconvBinary || $ffmpegBinary) { // FIXME // a bit hacky but didn't want to use subclasses diff --git a/lib/private/Setup/MySQL.php b/lib/private/Setup/MySQL.php index 9d80bd49aed..d3b39007aa9 100644 --- a/lib/private/Setup/MySQL.php +++ b/lib/private/Setup/MySQL.php @@ -157,7 +157,7 @@ class MySQL extends AbstractDatabase { } else { break; } - }; + } } } catch (\Exception $ex) { $this->logger->logException($ex, [ diff --git a/lib/private/Setup/PostgreSQL.php b/lib/private/Setup/PostgreSQL.php index 9a2e76ae541..8e80c74d968 100644 --- a/lib/private/Setup/PostgreSQL.php +++ b/lib/private/Setup/PostgreSQL.php @@ -154,7 +154,7 @@ class PostgreSQL extends AbstractDatabase { while ($this->userExists($connection)) { $i++; $this->dbUser = $dbUser . $i; - }; + } // create the user $query = $connection->prepare("CREATE USER " . addslashes($this->dbUser) . " CREATEDB PASSWORD '" . addslashes($this->dbPassword) . "'"); diff --git a/lib/private/Share/Helper.php b/lib/private/Share/Helper.php index 2eba67004dd..04405943f3b 100644 --- a/lib/private/Share/Helper.php +++ b/lib/private/Share/Helper.php @@ -168,7 +168,7 @@ class Helper extends \OC\Share\Constants { if ($defaultExpireDate === 'yes') { $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['expireAfterDays'] = (int)$config->getAppValue('core', 'shareapi_expire_after_n_days', '7'); $defaultExpireSettings['enforceExpireDate'] = $enforceExpireDate === 'yes'; } diff --git a/lib/private/Share/Share.php b/lib/private/Share/Share.php index 35d84307548..465446c52b7 100644 --- a/lib/private/Share/Share.php +++ b/lib/private/Share/Share.php @@ -1546,8 +1546,8 @@ class Share extends Constants { 'error' => &$error ); - $preHookData['itemTarget'] = ($isGroupShare) ? $groupItemTarget : $itemTarget; - $preHookData['shareWith'] = ($isGroupShare) ? $shareWith['group'] : $shareWith; + $preHookData['itemTarget'] = $isGroupShare ? $groupItemTarget : $itemTarget; + $preHookData['shareWith'] = $isGroupShare ? $shareWith['group'] : $shareWith; \OC_Hook::emit('OCP\Share', 'pre_shared', $preHookData); @@ -1559,7 +1559,7 @@ class Share extends Constants { $sourceId = ($itemType === 'file' || $itemType === 'folder') ? $fileSource : $itemSource; $sourceExists = self::getItemSharedWithBySource($itemType, $sourceId, self::FORMAT_NONE, null, true, $user); - $userShareType = ($isGroupShare) ? self::$shareTypeGroupUserUnique : $shareType; + $userShareType = $isGroupShare ? self::$shareTypeGroupUserUnique : $shareType; if ($sourceExists && $sourceExists['item_source'] === $itemSource) { $fileTarget = $sourceExists['file_target']; @@ -1659,9 +1659,9 @@ class Share extends Constants { 'expirationDate' => $expirationDate, ); - $postHookData['shareWith'] = ($isGroupShare) ? $shareWith['group'] : $shareWith; - $postHookData['itemTarget'] = ($isGroupShare) ? $groupItemTarget : $itemTarget; - $postHookData['fileTarget'] = ($isGroupShare) ? $groupFileTarget : $fileTarget; + $postHookData['shareWith'] = $isGroupShare ? $shareWith['group'] : $shareWith; + $postHookData['itemTarget'] = $isGroupShare ? $groupItemTarget : $itemTarget; + $postHookData['fileTarget'] = $isGroupShare ? $groupFileTarget : $fileTarget; \OC_Hook::emit('OCP\Share', 'post_shared', $postHookData); diff --git a/lib/private/Share20/Manager.php b/lib/private/Share20/Manager.php index b8131425b4a..48c70606835 100644 --- a/lib/private/Share20/Manager.php +++ b/lib/private/Share20/Manager.php @@ -536,7 +536,7 @@ class Manager implements IManager { /** @var \OCA\Files_Sharing\SharedStorage $storage */ $share->setParent($storage->getShareId()); } - }; + } } /** diff --git a/lib/private/Template/JSConfigHelper.php b/lib/private/Template/JSConfigHelper.php index ab52704d1e2..b8bff074200 100644 --- a/lib/private/Template/JSConfigHelper.php +++ b/lib/private/Template/JSConfigHelper.php @@ -219,7 +219,7 @@ class JSConfigHelper { 'versionstring' => \OC_Util::getVersionString(), 'enable_avatars' => true, // here for legacy reasons - to not crash existing code that relies on this value 'lost_password_link'=> $this->config->getSystemValue('lost_password_link', null), - 'modRewriteWorking' => ($this->config->getSystemValue('htaccess.IgnoreFrontController', false) === true || getenv('front_controller_active') === 'true'), + 'modRewriteWorking' => $this->config->getSystemValue('htaccess.IgnoreFrontController', false) === true || getenv('front_controller_active') === 'true', 'sharing.maxAutocompleteResults' => (int)$this->config->getSystemValue('sharing.maxAutocompleteResults', 0), 'sharing.minSearchStringLength' => (int)$this->config->getSystemValue('sharing.minSearchStringLength', 0), 'blacklist_files_regex' => \OCP\Files\FileInfo::BLACKLIST_FILES_REGEX, diff --git a/lib/private/User/User.php b/lib/private/User/User.php index d352101ba40..56c489181de 100644 --- a/lib/private/User/User.php +++ b/lib/private/User/User.php @@ -352,7 +352,7 @@ class User implements IUser { public function setEnabled($enabled) { $oldStatus = $this->isEnabled(); $this->enabled = $enabled; - $enabled = ($enabled) ? 'true' : 'false'; + $enabled = $enabled ? 'true' : 'false'; if ($oldStatus !== $this->enabled) { $this->triggerChange('enabled', $enabled); $this->config->setUserValue($this->uid, 'core', 'enabled', $enabled); diff --git a/lib/private/legacy/eventsource.php b/lib/private/legacy/eventsource.php index 74beb157e18..1a8061c0ed2 100644 --- a/lib/private/legacy/eventsource.php +++ b/lib/private/legacy/eventsource.php @@ -81,7 +81,7 @@ class OC_EventSource implements \OCP\IEventSource { header('Location: '.\OC::$WEBROOT); exit(); } - if (!(\OC::$server->getRequest()->passesCSRFCheck())) { + if (!\OC::$server->getRequest()->passesCSRFCheck()) { $this->send('error', 'Possible CSRF attack. Connection will be closed.'); $this->close(); exit(); diff --git a/lib/private/legacy/helper.php b/lib/private/legacy/helper.php index cd69b40b76b..8373c191dce 100644 --- a/lib/private/legacy/helper.php +++ b/lib/private/legacy/helper.php @@ -408,7 +408,7 @@ class OC_Helper { $it = new RecursiveIteratorIterator($aIt); while ($it->valid()) { - if (((isset($index) AND ($it->key() == $index)) OR (!isset($index))) AND ($it->current() == $needle)) { + if (((isset($index) AND ($it->key() == $index)) OR !isset($index)) AND ($it->current() == $needle)) { return $aIt->key(); } diff --git a/lib/private/legacy/image.php b/lib/private/legacy/image.php index eeee3b24073..d9af45f2226 100644 --- a/lib/private/legacy/image.php +++ b/lib/private/legacy/image.php @@ -785,12 +785,12 @@ class OC_Image implements \OCP\IImage { break; case 8: $color = @unpack('n', $vide . ($data[$p] ?? '')); - $color[1] = (isset($palette[$color[1] + 1])) ? $palette[$color[1] + 1] : $palette[1]; + $color[1] = isset($palette[$color[1] + 1]) ? $palette[$color[1] + 1] : $palette[1]; break; case 4: $color = @unpack('n', $vide . ($data[floor($p)] ?? '')); $color[1] = ($p * 2) % 2 == 0 ? $color[1] >> 4 : $color[1] & 0x0F; - $color[1] = (isset($palette[$color[1] + 1])) ? $palette[$color[1] + 1] : $palette[1]; + $color[1] = isset($palette[$color[1] + 1]) ? $palette[$color[1] + 1] : $palette[1]; break; case 1: $color = @unpack('n', $vide . ($data[floor($p)] ?? '')); @@ -820,7 +820,7 @@ class OC_Image implements \OCP\IImage { $color[1] = ($color[1] & 0x1); break; } - $color[1] = (isset($palette[$color[1] + 1])) ? $palette[$color[1] + 1] : $palette[1]; + $color[1] = isset($palette[$color[1] + 1]) ? $palette[$color[1] + 1] : $palette[1]; break; default: fclose($fh); diff --git a/lib/private/legacy/json.php b/lib/private/legacy/json.php index 7bfc815ab24..0afa179b3d8 100644 --- a/lib/private/legacy/json.php +++ b/lib/private/legacy/json.php @@ -91,7 +91,7 @@ class OC_JSON{ exit(); } - if( !(\OC::$server->getRequest()->passesCSRFCheck())) { + if( !\OC::$server->getRequest()->passesCSRFCheck()) { $l = \OC::$server->getL10N('lib'); self::error(array( 'data' => array( 'message' => $l->t('Token expired. Please reload page.'), 'error' => 'token_expired' ))); exit(); diff --git a/lib/private/legacy/util.php b/lib/private/legacy/util.php index efa488b434d..7e083b2ba0e 100644 --- a/lib/private/legacy/util.php +++ b/lib/private/legacy/util.php @@ -894,7 +894,7 @@ class OC_Util { } foreach($invalidIniSettings as $setting) { if(is_bool($setting[1])) { - $setting[1] = ($setting[1]) ? 'on' : 'off'; + $setting[1] = $setting[1] ? 'on' : 'off'; } $errors[] = [ 'error' => $l->t('PHP setting "%s" is not set to "%s".', [$setting[0], var_export($setting[1], true)]), |