diff options
79 files changed, 101 insertions, 101 deletions
diff --git a/apps/dav/lib/DAV/Sharing/Backend.php b/apps/dav/lib/DAV/Sharing/Backend.php index 141c54899ad..87c094c6d62 100644 --- a/apps/dav/lib/DAV/Sharing/Backend.php +++ b/apps/dav/lib/DAV/Sharing/Backend.php @@ -193,7 +193,7 @@ class Backend { 'href' => "principal:${row['principaluri']}", 'commonName' => isset($p['{DAV:}displayname']) ? $p['{DAV:}displayname'] : '', 'status' => 1, - 'readOnly' => ((int) $row['access'] === self::ACCESS_READ), + 'readOnly' => (int) $row['access'] === self::ACCESS_READ, '{http://owncloud.org/ns}principal' => $row['principaluri'], '{http://owncloud.org/ns}group-share' => is_null($p) ]; diff --git a/apps/dav/lib/SystemTag/SystemTagsObjectMappingCollection.php b/apps/dav/lib/SystemTag/SystemTagsObjectMappingCollection.php index 9e1dee38fbd..b23bf8f14db 100644 --- a/apps/dav/lib/SystemTag/SystemTagsObjectMappingCollection.php +++ b/apps/dav/lib/SystemTag/SystemTagsObjectMappingCollection.php @@ -147,7 +147,7 @@ class SystemTagsObjectMappingCollection implements ICollection { function childExists($tagId) { try { - $result = ($this->tagMapper->haveTag([$this->objectId], $this->objectType, $tagId, true)); + $result = $this->tagMapper->haveTag([$this->objectId], $this->objectType, $tagId, true); if ($result) { $tags = $this->tagManager->getTagsByIds([$tagId]); diff --git a/apps/encryption/lib/KeyManager.php b/apps/encryption/lib/KeyManager.php index e52da123fe0..d1776cbe50c 100644 --- a/apps/encryption/lib/KeyManager.php +++ b/apps/encryption/lib/KeyManager.php @@ -211,7 +211,7 @@ class KeyManager { */ public function recoveryKeyExists() { $key = $this->getRecoveryKey(); - return (!empty($key)); + return !empty($key); } /** diff --git a/apps/files/lib/App.php b/apps/files/lib/App.php index b756b123c43..0bf9ae20525 100644 --- a/apps/files/lib/App.php +++ b/apps/files/lib/App.php @@ -57,7 +57,7 @@ class App { public static function extendJsConfig($settings) { $appConfig = json_decode($settings['array']['oc_appconfig'], true); - $maxChunkSize = (int)(\OC::$server->getConfig()->getAppValue('files', 'max_chunk_size', (10 * 1024 * 1024))); + $maxChunkSize = (int)\OC::$server->getConfig()->getAppValue('files', 'max_chunk_size', 10 * 1024 * 1024); $appConfig['files'] = [ 'max_chunk_size' => $maxChunkSize ]; diff --git a/apps/files/lib/Command/Scan.php b/apps/files/lib/Command/Scan.php index 4026af2db79..c3b63f053f5 100644 --- a/apps/files/lib/Command/Scan.php +++ b/apps/files/lib/Command/Scan.php @@ -322,7 +322,7 @@ class Scan extends Base { * @return string */ protected function formatExecTime() { - list($secs, ) = explode('.', sprintf("%.1f", ($this->execTime))); + list($secs, ) = explode('.', sprintf("%.1f", $this->execTime)); # if you want to have microseconds add this: . '.' . $tens; return date('H:i:s', $secs); diff --git a/apps/files/lib/Command/ScanAppData.php b/apps/files/lib/Command/ScanAppData.php index f347cb868b1..1eb22d5f68a 100644 --- a/apps/files/lib/Command/ScanAppData.php +++ b/apps/files/lib/Command/ScanAppData.php @@ -260,7 +260,7 @@ class ScanAppData extends Base { * @return string */ protected function formatExecTime() { - list($secs, ) = explode('.', sprintf("%.1f", ($this->execTime))); + list($secs, ) = explode('.', sprintf("%.1f", $this->execTime)); # if you want to have microseconds add this: . '.' . $tens; return date('H:i:s', $secs); diff --git a/apps/files/lib/Settings/Admin.php b/apps/files/lib/Settings/Admin.php index 4965c1e6c17..2f4406c150b 100644 --- a/apps/files/lib/Settings/Admin.php +++ b/apps/files/lib/Settings/Admin.php @@ -56,7 +56,7 @@ class Admin implements ISettings { $maxUploadFilesize = Util::humanFileSize(min($upload_max_filesize, $post_max_size)); $parameters = [ - 'uploadChangable' => (($htaccessWorking and $htaccessWritable) or $userIniWritable ), + 'uploadChangable' => ($htaccessWorking and $htaccessWritable) or $userIniWritable, 'uploadMaxFilesize' => $maxUploadFilesize, // max possible makes only sense on a 32 bit system 'displayMaxPossibleUploadSize' => PHP_INT_SIZE === 4, diff --git a/apps/files_external/lib/Lib/Auth/AmazonS3/AccessKey.php b/apps/files_external/lib/Lib/Auth/AmazonS3/AccessKey.php index dbf14b76da8..7da3458e54d 100644 --- a/apps/files_external/lib/Lib/Auth/AmazonS3/AccessKey.php +++ b/apps/files_external/lib/Lib/Auth/AmazonS3/AccessKey.php @@ -39,7 +39,7 @@ class AccessKey extends AuthMechanism { ->setScheme(self::SCHEME_AMAZONS3_ACCESSKEY) ->setText($l->t('Access key')) ->addParameters([ - (new DefinitionParameter('key', $l->t('Access key'))), + new DefinitionParameter('key', $l->t('Access key')), (new DefinitionParameter('secret', $l->t('Secret key'))) ->setType(DefinitionParameter::VALUE_PASSWORD), ]); diff --git a/apps/files_external/lib/Lib/Auth/OAuth1/OAuth1.php b/apps/files_external/lib/Lib/Auth/OAuth1/OAuth1.php index 2602d5de41b..6a95710b3ef 100644 --- a/apps/files_external/lib/Lib/Auth/OAuth1/OAuth1.php +++ b/apps/files_external/lib/Lib/Auth/OAuth1/OAuth1.php @@ -39,7 +39,7 @@ class OAuth1 extends AuthMechanism { ->addParameters([ (new DefinitionParameter('configured', 'configured')) ->setType(DefinitionParameter::VALUE_HIDDEN), - (new DefinitionParameter('app_key', $l->t('App key'))), + new DefinitionParameter('app_key', $l->t('App key')), (new DefinitionParameter('app_secret', $l->t('App secret'))) ->setType(DefinitionParameter::VALUE_PASSWORD), (new DefinitionParameter('token', 'token')) diff --git a/apps/files_external/lib/Lib/Auth/OAuth2/OAuth2.php b/apps/files_external/lib/Lib/Auth/OAuth2/OAuth2.php index 325efb0e1a0..a5317ae9fa6 100644 --- a/apps/files_external/lib/Lib/Auth/OAuth2/OAuth2.php +++ b/apps/files_external/lib/Lib/Auth/OAuth2/OAuth2.php @@ -39,7 +39,7 @@ class OAuth2 extends AuthMechanism { ->addParameters([ (new DefinitionParameter('configured', 'configured')) ->setType(DefinitionParameter::VALUE_HIDDEN), - (new DefinitionParameter('client_id', $l->t('Client ID'))), + new DefinitionParameter('client_id', $l->t('Client ID')), (new DefinitionParameter('client_secret', $l->t('Client secret'))) ->setType(DefinitionParameter::VALUE_PASSWORD), (new DefinitionParameter('token', 'token')) diff --git a/apps/files_external/lib/Lib/Auth/OpenStack/OpenStack.php b/apps/files_external/lib/Lib/Auth/OpenStack/OpenStack.php index 17c2c8bd146..ca1e0a08ae9 100644 --- a/apps/files_external/lib/Lib/Auth/OpenStack/OpenStack.php +++ b/apps/files_external/lib/Lib/Auth/OpenStack/OpenStack.php @@ -37,11 +37,11 @@ class OpenStack extends AuthMechanism { ->setScheme(self::SCHEME_OPENSTACK) ->setText($l->t('OpenStack')) ->addParameters([ - (new DefinitionParameter('user', $l->t('Username'))), + new DefinitionParameter('user', $l->t('Username')), (new DefinitionParameter('password', $l->t('Password'))) ->setType(DefinitionParameter::VALUE_PASSWORD), - (new DefinitionParameter('tenant', $l->t('Tenant name'))), - (new DefinitionParameter('url', $l->t('Identity endpoint URL'))), + new DefinitionParameter('tenant', $l->t('Tenant name')), + new DefinitionParameter('url', $l->t('Identity endpoint URL')), ]) ; } diff --git a/apps/files_external/lib/Lib/Auth/OpenStack/Rackspace.php b/apps/files_external/lib/Lib/Auth/OpenStack/Rackspace.php index caff8e26ae3..14398c1ad82 100644 --- a/apps/files_external/lib/Lib/Auth/OpenStack/Rackspace.php +++ b/apps/files_external/lib/Lib/Auth/OpenStack/Rackspace.php @@ -37,7 +37,7 @@ class Rackspace extends AuthMechanism { ->setScheme(self::SCHEME_OPENSTACK) ->setText($l->t('Rackspace')) ->addParameters([ - (new DefinitionParameter('user', $l->t('Username'))), + new DefinitionParameter('user', $l->t('Username')), (new DefinitionParameter('key', $l->t('API key'))) ->setType(DefinitionParameter::VALUE_PASSWORD), ]) diff --git a/apps/files_external/lib/Lib/Auth/Password/Password.php b/apps/files_external/lib/Lib/Auth/Password/Password.php index cf8d6b9f458..95a10ebb1d9 100644 --- a/apps/files_external/lib/Lib/Auth/Password/Password.php +++ b/apps/files_external/lib/Lib/Auth/Password/Password.php @@ -37,7 +37,7 @@ class Password extends AuthMechanism { ->setScheme(self::SCHEME_PASSWORD) ->setText($l->t('Username and password')) ->addParameters([ - (new DefinitionParameter('user', $l->t('Username'))), + new DefinitionParameter('user', $l->t('Username')), (new DefinitionParameter('password', $l->t('Password'))) ->setType(DefinitionParameter::VALUE_PASSWORD), ]); diff --git a/apps/files_external/lib/Lib/Auth/PublicKey/RSA.php b/apps/files_external/lib/Lib/Auth/PublicKey/RSA.php index 425a601d7e9..25c4a1767e9 100644 --- a/apps/files_external/lib/Lib/Auth/PublicKey/RSA.php +++ b/apps/files_external/lib/Lib/Auth/PublicKey/RSA.php @@ -47,8 +47,8 @@ class RSA extends AuthMechanism { ->setScheme(self::SCHEME_PUBLICKEY) ->setText($l->t('RSA public key')) ->addParameters([ - (new DefinitionParameter('user', $l->t('Username'))), - (new DefinitionParameter('public_key', $l->t('Public key'))), + new DefinitionParameter('user', $l->t('Username')), + new DefinitionParameter('public_key', $l->t('Public key')), (new DefinitionParameter('private_key', 'private_key')) ->setType(DefinitionParameter::VALUE_HIDDEN), ]) diff --git a/apps/files_external/lib/Lib/Backend/AmazonS3.php b/apps/files_external/lib/Lib/Backend/AmazonS3.php index 5625805601c..d21794a6847 100644 --- a/apps/files_external/lib/Lib/Backend/AmazonS3.php +++ b/apps/files_external/lib/Lib/Backend/AmazonS3.php @@ -42,7 +42,7 @@ class AmazonS3 extends Backend { ->setStorageClass('\OCA\Files_External\Lib\Storage\AmazonS3') ->setText($l->t('Amazon S3')) ->addParameters([ - (new DefinitionParameter('bucket', $l->t('Bucket'))), + new DefinitionParameter('bucket', $l->t('Bucket')), (new DefinitionParameter('hostname', $l->t('Hostname'))) ->setFlag(DefinitionParameter::FLAG_OPTIONAL), (new DefinitionParameter('port', $l->t('Port'))) diff --git a/apps/files_external/lib/Lib/Backend/DAV.php b/apps/files_external/lib/Lib/Backend/DAV.php index a8053f81d36..95d804ba943 100644 --- a/apps/files_external/lib/Lib/Backend/DAV.php +++ b/apps/files_external/lib/Lib/Backend/DAV.php @@ -42,7 +42,7 @@ class DAV extends Backend { ->setStorageClass('\OC\Files\Storage\DAV') ->setText($l->t('WebDAV')) ->addParameters([ - (new DefinitionParameter('host', $l->t('URL'))), + new DefinitionParameter('host', $l->t('URL')), (new DefinitionParameter('root', $l->t('Remote subfolder'))) ->setFlag(DefinitionParameter::FLAG_OPTIONAL), (new DefinitionParameter('secure', $l->t('Secure https://'))) diff --git a/apps/files_external/lib/Lib/Backend/FTP.php b/apps/files_external/lib/Lib/Backend/FTP.php index edb8884f595..12aee8114f3 100644 --- a/apps/files_external/lib/Lib/Backend/FTP.php +++ b/apps/files_external/lib/Lib/Backend/FTP.php @@ -42,7 +42,7 @@ class FTP extends Backend { ->setStorageClass('\OCA\Files_External\Lib\Storage\FTP') ->setText($l->t('FTP')) ->addParameters([ - (new DefinitionParameter('host', $l->t('Host'))), + new DefinitionParameter('host', $l->t('Host')), (new DefinitionParameter('root', $l->t('Remote subfolder'))) ->setFlag(DefinitionParameter::FLAG_OPTIONAL), (new DefinitionParameter('secure', $l->t('Secure ftps://'))) diff --git a/apps/files_external/lib/Lib/Backend/Local.php b/apps/files_external/lib/Lib/Backend/Local.php index 298b0af1c7a..528528f2923 100644 --- a/apps/files_external/lib/Lib/Backend/Local.php +++ b/apps/files_external/lib/Lib/Backend/Local.php @@ -38,7 +38,7 @@ class Local extends Backend { ->setStorageClass('\OC\Files\Storage\Local') ->setText($l->t('Local')) ->addParameters([ - (new DefinitionParameter('datadir', $l->t('Location'))), + new DefinitionParameter('datadir', $l->t('Location')), ]) ->setAllowedVisibility(BackendService::VISIBILITY_ADMIN) ->setPriority(BackendService::PRIORITY_DEFAULT + 50) diff --git a/apps/files_external/lib/Lib/Backend/OwnCloud.php b/apps/files_external/lib/Lib/Backend/OwnCloud.php index 0d3ffb30b40..7dcd1f27212 100644 --- a/apps/files_external/lib/Lib/Backend/OwnCloud.php +++ b/apps/files_external/lib/Lib/Backend/OwnCloud.php @@ -40,7 +40,7 @@ class OwnCloud extends Backend { ->setStorageClass('\OCA\Files_External\Lib\Storage\OwnCloud') ->setText($l->t('Nextcloud')) ->addParameters([ - (new DefinitionParameter('host', $l->t('URL'))), + new DefinitionParameter('host', $l->t('URL')), (new DefinitionParameter('root', $l->t('Remote subfolder'))) ->setFlag(DefinitionParameter::FLAG_OPTIONAL), (new DefinitionParameter('secure', $l->t('Secure https://'))) diff --git a/apps/files_external/lib/Lib/Backend/SFTP.php b/apps/files_external/lib/Lib/Backend/SFTP.php index c9b31272999..561e0496083 100644 --- a/apps/files_external/lib/Lib/Backend/SFTP.php +++ b/apps/files_external/lib/Lib/Backend/SFTP.php @@ -36,7 +36,7 @@ class SFTP extends Backend { ->setStorageClass('\OCA\Files_External\Lib\Storage\SFTP') ->setText($l->t('SFTP')) ->addParameters([ - (new DefinitionParameter('host', $l->t('Host'))), + new DefinitionParameter('host', $l->t('Host')), (new DefinitionParameter('root', $l->t('Root'))) ->setFlag(DefinitionParameter::FLAG_OPTIONAL), ]) diff --git a/apps/files_external/lib/Lib/Backend/SFTP_Key.php b/apps/files_external/lib/Lib/Backend/SFTP_Key.php index 80ac1ceecc4..62f108cd9dd 100644 --- a/apps/files_external/lib/Lib/Backend/SFTP_Key.php +++ b/apps/files_external/lib/Lib/Backend/SFTP_Key.php @@ -38,7 +38,7 @@ class SFTP_Key extends Backend { ->setStorageClass('\OCA\Files_External\Lib\Storage\SFTP') ->setText($l->t('SFTP with secret key login')) ->addParameters([ - (new DefinitionParameter('host', $l->t('Host'))), + new DefinitionParameter('host', $l->t('Host')), (new DefinitionParameter('root', $l->t('Remote subfolder'))) ->setFlag(DefinitionParameter::FLAG_OPTIONAL), ]) diff --git a/apps/files_external/lib/Lib/Backend/SMB.php b/apps/files_external/lib/Lib/Backend/SMB.php index c4aadbd13f6..38e386005ad 100644 --- a/apps/files_external/lib/Lib/Backend/SMB.php +++ b/apps/files_external/lib/Lib/Backend/SMB.php @@ -44,8 +44,8 @@ class SMB extends Backend { ->setStorageClass('\OCA\Files_External\Lib\Storage\SMB') ->setText($l->t('SMB / CIFS')) ->addParameters([ - (new DefinitionParameter('host', $l->t('Host'))), - (new DefinitionParameter('share', $l->t('Share'))), + new DefinitionParameter('host', $l->t('Host')), + new DefinitionParameter('share', $l->t('Share')), (new DefinitionParameter('root', $l->t('Remote subfolder'))) ->setFlag(DefinitionParameter::FLAG_OPTIONAL), (new DefinitionParameter('domain', $l->t('Domain'))) diff --git a/apps/files_external/lib/Lib/Backend/SMB_OC.php b/apps/files_external/lib/Lib/Backend/SMB_OC.php index 76126fd649f..54d941ff1db 100644 --- a/apps/files_external/lib/Lib/Backend/SMB_OC.php +++ b/apps/files_external/lib/Lib/Backend/SMB_OC.php @@ -46,7 +46,7 @@ class SMB_OC extends Backend { ->setStorageClass('\OCA\Files_External\Lib\Storage\SMB') ->setText($l->t('SMB / CIFS using OC login')) ->addParameters([ - (new DefinitionParameter('host', $l->t('Host'))), + new DefinitionParameter('host', $l->t('Host')), (new DefinitionParameter('username_as_share', $l->t('Username as share'))) ->setType(DefinitionParameter::VALUE_BOOLEAN), (new DefinitionParameter('share', $l->t('Share'))) diff --git a/apps/files_external/lib/Lib/Backend/Swift.php b/apps/files_external/lib/Lib/Backend/Swift.php index 52ed66b95ae..b0a69ae51e0 100644 --- a/apps/files_external/lib/Lib/Backend/Swift.php +++ b/apps/files_external/lib/Lib/Backend/Swift.php @@ -46,7 +46,7 @@ class Swift extends Backend { ->setFlag(DefinitionParameter::FLAG_OPTIONAL), (new DefinitionParameter('region', $l->t('Region'))) ->setFlag(DefinitionParameter::FLAG_OPTIONAL), - (new DefinitionParameter('bucket', $l->t('Bucket'))), + new DefinitionParameter('bucket', $l->t('Bucket')), (new DefinitionParameter('timeout', $l->t('Request timeout (seconds)'))) ->setFlag(DefinitionParameter::FLAG_OPTIONAL), ]) diff --git a/apps/files_external/lib/Lib/Storage/FTP.php b/apps/files_external/lib/Lib/Storage/FTP.php index 427a076ffe1..17afb1fcf95 100644 --- a/apps/files_external/lib/Lib/Storage/FTP.php +++ b/apps/files_external/lib/Lib/Storage/FTP.php @@ -150,7 +150,7 @@ class FTP extends StreamWrapper{ */ public static function checkDependencies() { if (function_exists('ftp_login')) { - return(true); + return true; } else { return array('ftp'); } diff --git a/apps/files_external/lib/Lib/Storage/Swift.php b/apps/files_external/lib/Lib/Storage/Swift.php index aeedd3dcd63..aaa7e95bbdf 100644 --- a/apps/files_external/lib/Lib/Storage/Swift.php +++ b/apps/files_external/lib/Lib/Storage/Swift.php @@ -170,7 +170,7 @@ class Swift extends \OC\Files\Storage\Common { $bucketUrl = Url::factory($params['bucket']); if ($bucketUrl->isAbsolute()) { - $this->bucket = end(($bucketUrl->getPathSegments())); + $this->bucket = end($bucketUrl->getPathSegments()); $params['endpoint_url'] = $bucketUrl->addPath('..')->normalizePath(); } else { $this->bucket = $params['bucket']; diff --git a/apps/files_external/lib/Service/BackendService.php b/apps/files_external/lib/Service/BackendService.php index 49af01f5bf9..bd6c525f319 100644 --- a/apps/files_external/lib/Service/BackendService.php +++ b/apps/files_external/lib/Service/BackendService.php @@ -194,7 +194,7 @@ class BackendService { */ public function getAvailableBackends() { return array_filter($this->getBackends(), function($backend) { - return !($backend->checkDependencies()); + return !$backend->checkDependencies(); }); } diff --git a/apps/files_sharing/lib/Helper.php b/apps/files_sharing/lib/Helper.php index c8f46fa8132..684c20c4544 100644 --- a/apps/files_sharing/lib/Helper.php +++ b/apps/files_sharing/lib/Helper.php @@ -225,7 +225,7 @@ class Helper { */ public static function generateUniqueTarget($path, $excludeList, $view) { $pathinfo = pathinfo($path); - $ext = (isset($pathinfo['extension'])) ? '.'.$pathinfo['extension'] : ''; + $ext = isset($pathinfo['extension']) ? '.'.$pathinfo['extension'] : ''; $name = $pathinfo['filename']; $dir = $pathinfo['dirname']; $i = 2; diff --git a/apps/files_sharing/lib/ShareBackend/File.php b/apps/files_sharing/lib/ShareBackend/File.php index 83474546581..e09591b37c0 100644 --- a/apps/files_sharing/lib/ShareBackend/File.php +++ b/apps/files_sharing/lib/ShareBackend/File.php @@ -117,7 +117,7 @@ class File implements \OCP\Share_Backend_File_Dependent { } } - $excludeList = (is_array($exclude)) ? $exclude : array(); + $excludeList = is_array($exclude) ? $exclude : array(); return \OCA\Files_Sharing\Helper::generateUniqueTarget($target, $excludeList, $view); } diff --git a/apps/files_sharing/lib/SharedMount.php b/apps/files_sharing/lib/SharedMount.php index 4f0dc89e997..d90673421cd 100644 --- a/apps/files_sharing/lib/SharedMount.php +++ b/apps/files_sharing/lib/SharedMount.php @@ -131,7 +131,7 @@ class SharedMount extends MountPoint implements MoveableMount { */ private function generateUniqueTarget($path, $view, array $mountpoints) { $pathinfo = pathinfo($path); - $ext = (isset($pathinfo['extension'])) ? '.' . $pathinfo['extension'] : ''; + $ext = isset($pathinfo['extension']) ? '.' . $pathinfo['extension'] : ''; $name = $pathinfo['filename']; $dir = $pathinfo['dirname']; diff --git a/apps/files_trashbin/lib/Trashbin.php b/apps/files_trashbin/lib/Trashbin.php index ca4b406c648..a9eb5224728 100644 --- a/apps/files_trashbin/lib/Trashbin.php +++ b/apps/files_trashbin/lib/Trashbin.php @@ -873,10 +873,10 @@ class Trashbin { foreach ($matches as $ma) { if ($timestamp) { $parts = explode('.v', substr($ma['path'], 0, $offset)); - $versions[] = (end($parts)); + $versions[] = end($parts); } else { $parts = explode('.v', $ma); - $versions[] = (end($parts)); + $versions[] = end($parts); } } } diff --git a/apps/user_ldap/lib/Access.php b/apps/user_ldap/lib/Access.php index 9b367d6edc2..3d182077764 100644 --- a/apps/user_ldap/lib/Access.php +++ b/apps/user_ldap/lib/Access.php @@ -746,7 +746,7 @@ class Access extends LDAPUtility implements IUserTools { */ private function _createAltInternalOwnCloudNameForGroups($name) { $usedNames = $this->groupMapper->getNamesBySearch($name, "", '_%'); - if(!($usedNames) || count($usedNames) === 0) { + if(!$usedNames || count($usedNames) === 0) { $lastNo = 1; //will become name_2 } else { natsort($usedNames); @@ -842,7 +842,7 @@ class Access extends LDAPUtility implements IUserTools { }); } $this->batchApplyUserAttributes($recordsToUpdate); - return $this->fetchList($ldapRecords, (count($attr) > 1)); + return $this->fetchList($ldapRecords, count($attr) > 1); } /** @@ -886,7 +886,7 @@ class Access extends LDAPUtility implements IUserTools { * @return array */ public function fetchListOfGroups($filter, $attr, $limit = null, $offset = null) { - return $this->fetchList($this->searchGroups($filter, $attr, $limit, $offset), (count($attr) > 1)); + return $this->fetchList($this->searchGroups($filter, $attr, $limit, $offset), count($attr) > 1); } /** diff --git a/apps/user_ldap/lib/Connection.php b/apps/user_ldap/lib/Connection.php index 25d3f66c52d..1ea3cc67303 100644 --- a/apps/user_ldap/lib/Connection.php +++ b/apps/user_ldap/lib/Connection.php @@ -113,7 +113,7 @@ class Connection extends LDAPUtility { public function __destruct() { if(!$this->dontDestruct && $this->ldap->isResource($this->ldapConnectionRes)) { @$this->ldap->unbind($this->ldapConnectionRes); - }; + } } /** diff --git a/apps/user_ldap/lib/Group_Proxy.php b/apps/user_ldap/lib/Group_Proxy.php index ad3fba4092f..9fccb64cd46 100644 --- a/apps/user_ldap/lib/Group_Proxy.php +++ b/apps/user_ldap/lib/Group_Proxy.php @@ -73,7 +73,7 @@ class Group_Proxy extends Proxy implements \OCP\GroupInterface, IGroupLDAP { * @return mixed, the result of the method or false */ protected function callOnLastSeenOn($gid, $method, $parameters, $passOnWhen) { - $cacheKey = $this->getGroupCacheKey($gid);; + $cacheKey = $this->getGroupCacheKey($gid); $prefix = $this->getFromCache($cacheKey); //in case the uid has been found in the past, try this stored connection first if(!is_null($prefix)) { diff --git a/apps/user_ldap/lib/User_LDAP.php b/apps/user_ldap/lib/User_LDAP.php index 4943a370316..5a2b993c334 100644 --- a/apps/user_ldap/lib/User_LDAP.php +++ b/apps/user_ldap/lib/User_LDAP.php @@ -549,7 +549,7 @@ class User_LDAP extends BackendUtility implements \OCP\IUserBackend, \OCP\UserIn | Backend::GET_DISPLAYNAME | Backend::PROVIDE_AVATAR | Backend::COUNT_USERS - | (((int)$this->access->connection->turnOnPasswordChange === 1)?(Backend::SET_PASSWORD):0) + | (((int)$this->access->connection->turnOnPasswordChange === 1)? Backend::SET_PASSWORD :0) | $this->userPluginManager->getImplementedActions()) & $actions); } diff --git a/apps/user_ldap/lib/Wizard.php b/apps/user_ldap/lib/Wizard.php index 57f900a8865..23c4976c2fa 100644 --- a/apps/user_ldap/lib/Wizard.php +++ b/apps/user_ldap/lib/Wizard.php @@ -245,7 +245,7 @@ class Wizard extends LDAPUtility { $this->applyFind('ldap_display_name', $attr); return $this->result; } - }; + } throw new \Exception(self::$l->t('Could not detect user display name attribute. Please specify it yourself in advanced LDAP settings.')); } diff --git a/apps/user_ldap/templates/renewpassword.php b/apps/user_ldap/templates/renewpassword.php index 7b1df75e06b..9fc4271d6be 100644 --- a/apps/user_ldap/templates/renewpassword.php +++ b/apps/user_ldap/templates/renewpassword.php @@ -23,7 +23,7 @@ style('user_ldap', 'renewPassword'); <?php p($message); ?><br> </div> <?php endforeach; ?> - <?php if (isset($_['internalexception']) && ($_['internalexception'])): ?> + <?php if (isset($_['internalexception']) && $_['internalexception']): ?> <div class="warning"> <?php p($l->t('An internal error occurred.')); ?><br> <small><?php p($l->t('Please try again or contact your administrator.')); ?></small> diff --git a/apps/user_ldap/templates/settings.php b/apps/user_ldap/templates/settings.php index 42bbaaf78ca..1e1c85db247 100644 --- a/apps/user_ldap/templates/settings.php +++ b/apps/user_ldap/templates/settings.php @@ -71,10 +71,10 @@ style('user_ldap', 'settings'); print_unescaped('<p class="ldapwarning">'.$l->t('<b>Warning:</b> The PHP LDAP module is not installed, the backend will not work. Please ask your system administrator to install it.').'</p>'); } ?> - <?php require_once(__DIR__ . '/part.wizard-server.php'); ?> - <?php require_once(__DIR__ . '/part.wizard-userfilter.php'); ?> - <?php require_once(__DIR__ . '/part.wizard-loginfilter.php'); ?> - <?php require_once(__DIR__ . '/part.wizard-groupfilter.php'); ?> + <?php require_once __DIR__ . '/part.wizard-server.php'; ?> + <?php require_once __DIR__ . '/part.wizard-userfilter.php'; ?> + <?php require_once __DIR__ . '/part.wizard-loginfilter.php'; ?> + <?php require_once __DIR__ . '/part.wizard-groupfilter.php'; ?> <fieldset id="ldapSettings-1"> <div id="ldapAdvancedAccordion"> <h3><?php p($l->t('Connection Settings'));?></h3> diff --git a/core/Command/App/ListApps.php b/core/Command/App/ListApps.php index c933a2519ef..78b7dd40fe3 100644 --- a/core/Command/App/ListApps.php +++ b/core/Command/App/ListApps.php @@ -87,7 +87,7 @@ class ListApps extends Base { sort($enabledApps); foreach ($enabledApps as $app) { - $apps['enabled'][$app] = (isset($versions[$app])) ? $versions[$app] : true; + $apps['enabled'][$app] = isset($versions[$app]) ? $versions[$app] : true; } sort($disabledApps); diff --git a/core/Command/Base.php b/core/Command/Base.php index 15878a807d8..536de20711c 100644 --- a/core/Command/Base.php +++ b/core/Command/Base.php @@ -121,7 +121,7 @@ class Base extends Command implements CompletionAwareInterface { } else if ($value === true) { return 'true'; } else if ($value === null) { - return ($returnNull) ? null : 'null'; + return $returnNull ? null : 'null'; } else { return $value; } diff --git a/core/Command/Encryption/ChangeKeyStorageRoot.php b/core/Command/Encryption/ChangeKeyStorageRoot.php index 97709d54bdd..7c6ad5d6126 100644 --- a/core/Command/Encryption/ChangeKeyStorageRoot.php +++ b/core/Command/Encryption/ChangeKeyStorageRoot.php @@ -118,7 +118,7 @@ class ChangeKeyStorageRoot extends Command { $output->writeln("Start to move keys:"); - if ($this->rootView->is_dir(($oldRoot)) === false) { + if ($this->rootView->is_dir($oldRoot) === false) { $output->writeln("No old keys found: Nothing needs to be moved"); return false; } diff --git a/core/Command/Maintenance/Install.php b/core/Command/Maintenance/Install.php index be6a2da22c8..262def99c5f 100644 --- a/core/Command/Maintenance/Install.php +++ b/core/Command/Maintenance/Install.php @@ -90,7 +90,7 @@ class Install extends Command { // ignore the OS X setup warning if(count($errors) !== 1 || - (string)($errors[0]['error']) !== 'Mac OS X is not supported and Nextcloud will not work properly on this platform. Use it at your own risk! ') { + (string)$errors[0]['error'] !== 'Mac OS X is not supported and Nextcloud will not work properly on this platform. Use it at your own risk! ') { return 1; } } diff --git a/core/Command/User/Info.php b/core/Command/User/Info.php index b23ddd942a0..f1b5579eb94 100644 --- a/core/Command/User/Info.php +++ b/core/Command/User/Info.php @@ -76,7 +76,7 @@ class Info extends Base { $data = [ 'user_id' => $user->getUID(), 'display_name' => $user->getDisplayName(), - 'email' => ($user->getEMailAddress()) ? $user->getEMailAddress() : '', + 'email' => $user->getEMailAddress() ? $user->getEMailAddress() : '', 'cloud_id' => $user->getCloudId(), 'enabled' => $user->isEnabled(), 'groups' => $groups, diff --git a/core/templates/layout.base.php b/core/templates/layout.base.php index 7c1fe79e79d..a5096b87b93 100644 --- a/core/templates/layout.base.php +++ b/core/templates/layout.base.php @@ -17,7 +17,7 @@ <?php print_unescaped($_['headers']); ?> </head> <body id="body-public"> - <?php include('layout.noscript.warning.php'); ?> + <?php include 'layout.noscript.warning.php'; ?> <?php print_unescaped($_['content']); ?> </body> </html> diff --git a/core/templates/layout.guest.php b/core/templates/layout.guest.php index 4d06fc294d5..e208af3c507 100644 --- a/core/templates/layout.guest.php +++ b/core/templates/layout.guest.php @@ -19,7 +19,7 @@ <?php print_unescaped($_['headers']); ?> </head> <body id="<?php p($_['bodyid']);?>"> - <?php include('layout.noscript.warning.php'); ?> + <?php include 'layout.noscript.warning.php'; ?> <div class="wrapper"> <div class="v-align"> <?php if ($_['bodyid'] === 'body-login' ): ?> diff --git a/core/templates/layout.user.php b/core/templates/layout.user.php index 32762e2c240..c6885f692d5 100644 --- a/core/templates/layout.user.php +++ b/core/templates/layout.user.php @@ -26,7 +26,7 @@ <?php print_unescaped($_['headers']); ?> </head> <body id="<?php p($_['bodyid']);?>"> - <?php include('layout.noscript.warning.php'); ?> + <?php include 'layout.noscript.warning.php'; ?> <div id="notification-container"> <div id="notification"></div> </div> diff --git a/core/templates/login.php b/core/templates/login.php index 82594481d87..1d9b24901e7 100644 --- a/core/templates/login.php +++ b/core/templates/login.php @@ -10,7 +10,7 @@ script('core', 'merged-login'); <?php if (!empty($_['redirect_url'])) { print_unescaped('<input type="hidden" name="redirect_url" value="' . \OCP\Util::sanitizeHTML($_['redirect_url']) . '">'); } ?> - <?php if (isset($_['apacheauthfailed']) && ($_['apacheauthfailed'])): ?> + <?php if (isset($_['apacheauthfailed']) && $_['apacheauthfailed']): ?> <div class="warning"> <?php p($l->t('Server side authentication failed!')); ?><br> <small><?php p($l->t('Please contact your administrator.')); ?></small> @@ -21,7 +21,7 @@ script('core', 'merged-login'); <?php p($message); ?><br> </div> <?php endforeach; ?> - <?php if (isset($_['internalexception']) && ($_['internalexception'])): ?> + <?php if (isset($_['internalexception']) && $_['internalexception']): ?> <div class="warning"> <?php p($l->t('An internal error occurred.')); ?><br> <small><?php p($l->t('Please try again or contact your administrator.')); ?></small> diff --git a/lib/base.php b/lib/base.php index 590ca42040f..fdebe283b9c 100644 --- a/lib/base.php +++ b/lib/base.php @@ -352,7 +352,7 @@ class OC { $currentVersion = implode('.', \OCP\Util::getVersion()); // if not a core upgrade, then it's apps upgrade - $isAppsOnlyUpgrade = (version_compare($currentVersion, $installedVersion, '=')); + $isAppsOnlyUpgrade = version_compare($currentVersion, $installedVersion, '='); $oldTheme = $systemConfig->getValue('theme'); $systemConfig->setValue('theme', ''); @@ -603,7 +603,7 @@ class OC { if(!date_default_timezone_set('UTC')) { throw new \RuntimeException('Could not set timezone to UTC'); - }; + } //try to configure php to enable big file uploads. //this doesn´t work always depending on the webserver and php configuration. @@ -837,7 +837,7 @@ class OC { /** @var \OCP\App\ManagerEvent $event */ $jobList = \OC::$server->getJobList(); $job = 'OC\\Settings\\RemoveOrphaned'; - if(!($jobList->has($job, null))) { + if(!$jobList->has($job, null)) { $jobList->add($job); } }); 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)]), diff --git a/settings/Controller/MailSettingsController.php b/settings/Controller/MailSettingsController.php index 02bd51e843e..22e2662a216 100644 --- a/settings/Controller/MailSettingsController.php +++ b/settings/Controller/MailSettingsController.php @@ -101,7 +101,7 @@ class MailSettingsController extends Controller { $params = get_defined_vars(); $configs = []; foreach($params as $key => $value) { - $configs[$key] = (empty($value)) ? null : $value; + $configs[$key] = empty($value) ? null : $value; } // Delete passwords from config in case no auth is specified diff --git a/settings/Controller/UsersController.php b/settings/Controller/UsersController.php index c373cb0d521..7b18eda6833 100644 --- a/settings/Controller/UsersController.php +++ b/settings/Controller/UsersController.php @@ -254,7 +254,7 @@ class UsersController extends Controller { return [ 'name' => $user->getUID(), 'displayname' => $user->getDisplayName(), - 'groups' => (empty($userGroups)) ? $this->groupManager->getUserGroupIds($user) : $userGroups, + 'groups' => empty($userGroups) ? $this->groupManager->getUserGroupIds($user) : $userGroups, 'subadmin' => $subAdminGroups, 'quota' => $user->getQuota(), 'quota_bytes' => Util::computerFileSize($user->getQuota()), diff --git a/settings/templates/certificates.php b/settings/templates/certificates.php index ac0a2293800..d9587f97946 100644 --- a/settings/templates/certificates.php +++ b/settings/templates/certificates.php @@ -10,7 +10,7 @@ </thead> <tbody> <?php foreach ($_['certs'] as $rootCert): /**@var \OCP\ICertificate $rootCert */ ?> - <tr class="<?php echo ($rootCert->isExpired()) ? 'expired' : 'valid' ?>" + <tr class="<?php echo $rootCert->isExpired() ? 'expired' : 'valid' ?>" data-name="<?php p($rootCert->getName()) ?>"> <td class="rootCert" title="<?php p($rootCert->getOrganization()) ?>"> diff --git a/settings/templates/settings.php b/settings/templates/settings.php index 48b4e6b3234..44011af2884 100644 --- a/settings/templates/settings.php +++ b/settings/templates/settings.php @@ -6,4 +6,4 @@ <?php foreach($_['forms'] as $form) { print_unescaped($form); -}; +} diff --git a/settings/templates/settings/additional.php b/settings/templates/settings/additional.php index 2ad2c5af4e5..3af78adde71 100644 --- a/settings/templates/settings/additional.php +++ b/settings/templates/settings/additional.php @@ -30,4 +30,4 @@ if (isset($form['form'])) {?> <div id="<?php isset($form['anchor']) ? p($form['anchor']) : p('');?>"><?php print_unescaped($form['form']);?></div> <?php } -};?> +} ?> diff --git a/settings/templates/settings/admin/server.development.notice.php b/settings/templates/settings/admin/server.development.notice.php index d1af82bc9a9..42599c54459 100644 --- a/settings/templates/settings/admin/server.development.notice.php +++ b/settings/templates/settings/admin/server.development.notice.php @@ -1,3 +1,3 @@ <div class="section"> - <p><?php include(__DIR__ . '/../../settings.development.notice.php'); ?></p> + <p><?php include __DIR__ . '/../../settings.development.notice.php'; ?></p> </div> diff --git a/settings/templates/settings/admin/server.php b/settings/templates/settings/admin/server.php index 2805eb72ce1..4350a7105c8 100644 --- a/settings/templates/settings/admin/server.php +++ b/settings/templates/settings/admin/server.php @@ -132,7 +132,7 @@ <ol> <?php foreach(json_decode($_['cronErrors']) as $error) { if(isset($error->error)) {?> <li><?php p($error->error) ?> <?php p($error->hint) ?></li> - <?php }};?> + <?php }} ?> </ol> </li> <?php |