From 42625a46be495ea1c60ac8fe8e13946fd9ed9732 Mon Sep 17 00:00:00 2001 From: Christoph Wurst Date: Thu, 9 Apr 2020 16:05:56 +0200 Subject: [PATCH 1/6] Remove spaces after method or function call Signed-off-by: Christoph Wurst --- .../lib/Controller/RequestHandlerController.php | 2 +- apps/dav/lib/CalDAV/CachedSubscription.php | 2 +- apps/dav/lib/Connector/Sabre/File.php | 2 +- .../SystemTag/SystemTagsObjectMappingCollectionTest.php | 2 +- apps/encryption/lib/Controller/RecoveryController.php | 2 +- apps/encryption/lib/Crypto/EncryptAll.php | 4 ++-- apps/encryption/templates/settings-personal.php | 4 ++-- apps/files/lib/Command/Scan.php | 2 +- core/Command/TwoFactorAuth/State.php | 2 +- core/Controller/SetupController.php | 2 +- lib/base.php | 2 +- lib/private/Config.php | 6 +++--- lib/private/Files/View.php | 2 +- lib/private/legacy/OC_Template.php | 8 ++++---- lib/private/legacy/OC_Util.php | 8 ++++---- 15 files changed, 25 insertions(+), 25 deletions(-) diff --git a/apps/cloud_federation_api/lib/Controller/RequestHandlerController.php b/apps/cloud_federation_api/lib/Controller/RequestHandlerController.php index d99e6c2d00..3b8b29a49c 100644 --- a/apps/cloud_federation_api/lib/Controller/RequestHandlerController.php +++ b/apps/cloud_federation_api/lib/Controller/RequestHandlerController.php @@ -133,7 +133,7 @@ class RequestHandlerController extends Controller { $shareType === null || !is_array($protocol) || !isset($protocol['name']) || - !isset ($protocol['options']) || + !isset($protocol['options']) || !is_array($protocol['options']) || !isset($protocol['options']['sharedSecret']) ) { diff --git a/apps/dav/lib/CalDAV/CachedSubscription.php b/apps/dav/lib/CalDAV/CachedSubscription.php index baba0727f2..093a86dcad 100644 --- a/apps/dav/lib/CalDAV/CachedSubscription.php +++ b/apps/dav/lib/CalDAV/CachedSubscription.php @@ -135,7 +135,7 @@ class CachedSubscription extends \Sabre\CalDAV\Calendar { } $obj['acl'] = $this->getChildACL(); - return new CachedSubscriptionObject ($this->caldavBackend, $this->calendarInfo, $obj); + return new CachedSubscriptionObject($this->caldavBackend, $this->calendarInfo, $obj); } diff --git a/apps/dav/lib/Connector/Sabre/File.php b/apps/dav/lib/Connector/Sabre/File.php index 40075f68a7..125935fce5 100644 --- a/apps/dav/lib/Connector/Sabre/File.php +++ b/apps/dav/lib/Connector/Sabre/File.php @@ -512,7 +512,7 @@ class File extends Node implements IFile { $bytesWritten = $chunk_handler->store($info['index'], $data); //detect aborted upload - if (isset ($_SERVER['REQUEST_METHOD']) && $_SERVER['REQUEST_METHOD'] === 'PUT') { + if (isset($_SERVER['REQUEST_METHOD']) && $_SERVER['REQUEST_METHOD'] === 'PUT') { if (isset($_SERVER['CONTENT_LENGTH'])) { $expected = (int)$_SERVER['CONTENT_LENGTH']; if ($bytesWritten !== $expected) { diff --git a/apps/dav/tests/unit/SystemTag/SystemTagsObjectMappingCollectionTest.php b/apps/dav/tests/unit/SystemTag/SystemTagsObjectMappingCollectionTest.php index 35a81a03d3..c8482ffe77 100644 --- a/apps/dav/tests/unit/SystemTag/SystemTagsObjectMappingCollectionTest.php +++ b/apps/dav/tests/unit/SystemTag/SystemTagsObjectMappingCollectionTest.php @@ -62,7 +62,7 @@ class SystemTagsObjectMappingCollectionTest extends \Test\TestCase { } public function getNode() { - return new \OCA\DAV\SystemTag\SystemTagsObjectMappingCollection ( + return new \OCA\DAV\SystemTag\SystemTagsObjectMappingCollection( 111, 'files', $this->user, diff --git a/apps/encryption/lib/Controller/RecoveryController.php b/apps/encryption/lib/Controller/RecoveryController.php index 5cc5456844..534e00e1b2 100644 --- a/apps/encryption/lib/Controller/RecoveryController.php +++ b/apps/encryption/lib/Controller/RecoveryController.php @@ -121,7 +121,7 @@ class RecoveryController extends Controller { if (empty($newPassword)) { $errorMessage = (string)$this->l->t('Please provide a new recovery password'); - return new DataResponse (['data' => ['message' => $errorMessage]], Http::STATUS_BAD_REQUEST); + return new DataResponse(['data' => ['message' => $errorMessage]], Http::STATUS_BAD_REQUEST); } if (empty($confirmPassword)) { diff --git a/apps/encryption/lib/Crypto/EncryptAll.php b/apps/encryption/lib/Crypto/EncryptAll.php index 5c90631e85..d0aaafd061 100644 --- a/apps/encryption/lib/Crypto/EncryptAll.php +++ b/apps/encryption/lib/Crypto/EncryptAll.php @@ -473,11 +473,11 @@ class EncryptAll { protected function createMailBody($password) { $html = new \OC_Template("encryption", "mail", ""); - $html->assign ('password', $password); + $html->assign('password', $password); $htmlMail = $html->fetchPage(); $plainText = new \OC_Template("encryption", "altmail", ""); - $plainText->assign ('password', $password); + $plainText->assign('password', $password); $plainTextMail = $plainText->fetchPage(); return [$htmlMail, $plainTextMail]; diff --git a/apps/encryption/templates/settings-personal.php b/apps/encryption/templates/settings-personal.php index 41dacc534e..47860b2f20 100644 --- a/apps/encryption/templates/settings-personal.php +++ b/apps/encryption/templates/settings-personal.php @@ -56,7 +56,7 @@ script('encryption', 'settings-personal'); id="userEnableRecoveryCheckbox" name="userEnableRecovery" value="1" - /> + />
@@ -66,7 +66,7 @@ script('encryption', 'settings-personal'); id="userDisableRecoveryCheckbox" name="userEnableRecovery" value="0" - /> + />

diff --git a/apps/files/lib/Command/Scan.php b/apps/files/lib/Command/Scan.php index 38d4b1cc97..f628ed2e0e 100644 --- a/apps/files/lib/Command/Scan.php +++ b/apps/files/lib/Command/Scan.php @@ -173,7 +173,7 @@ class Scan extends Base { $inputPath = $input->getOption('path'); if ($inputPath) { $inputPath = '/' . trim($inputPath, '/'); - list (, $user,) = explode('/', $inputPath, 3); + list(, $user,) = explode('/', $inputPath, 3); $users = [$user]; } else if ($input->getOption('all')) { $users = $this->userManager->search(''); diff --git a/core/Command/TwoFactorAuth/State.php b/core/Command/TwoFactorAuth/State.php index 5f658e3050..3ae1884d34 100644 --- a/core/Command/TwoFactorAuth/State.php +++ b/core/Command/TwoFactorAuth/State.php @@ -62,7 +62,7 @@ class State extends Base { $providerStates = $this->registry->getProviderStates($user); $filtered = $this->filterEnabledDisabledUnknownProviders($providerStates); - list ($enabled, $disabled) = $filtered; + list($enabled, $disabled) = $filtered; if (!empty($enabled)) { $output->writeln("Two-factor authentication is enabled for user $uid"); diff --git a/core/Controller/SetupController.php b/core/Controller/SetupController.php index 7449717831..8205bb4920 100644 --- a/core/Controller/SetupController.php +++ b/core/Controller/SetupController.php @@ -134,7 +134,7 @@ class SetupController { \OCP\Util::writeLog('core', 'Autoconfig file found, setting up Nextcloud…', ILogger::INFO); $AUTOCONFIG = []; include $this->autoConfigFile; - $post = array_merge ($post, $AUTOCONFIG); + $post = array_merge($post, $AUTOCONFIG); } $dbIsSet = isset($post['dbtype']); diff --git a/lib/base.php b/lib/base.php index 6dc5948d53..f287815fa5 100644 --- a/lib/base.php +++ b/lib/base.php @@ -863,7 +863,7 @@ class OC { private static function registerAppRestrictionsHooks() { $groupManager = self::$server->query(\OCP\IGroupManager::class); - $groupManager->listen ('\OC\Group', 'postDelete', function (\OCP\IGroup $group) { + $groupManager->listen('\OC\Group', 'postDelete', function (\OCP\IGroup $group) { $appManager = self::$server->getAppManager(); $apps = $appManager->getEnabledAppsForGroup($group); foreach ($apps as $appId) { diff --git a/lib/private/Config.php b/lib/private/Config.php index d2ddab5069..0c5a9b0320 100644 --- a/lib/private/Config.php +++ b/lib/private/Config.php @@ -239,14 +239,14 @@ class Config { $content .= var_export($this->cache, true); $content .= ";\n"; - touch ($this->configFilePath); + touch($this->configFilePath); $filePointer = fopen($this->configFilePath, 'r+'); // Prevent others not to read the config chmod($this->configFilePath, 0640); // File does not exist, this can happen when doing a fresh install - if(!is_resource ($filePointer)) { + if(!is_resource($filePointer)) { throw new HintException( "Can't write into config directory!", 'This can usually be fixed by giving the webserver write access to the config directory.'); @@ -258,7 +258,7 @@ class Config { } // Write the config and release the lock - ftruncate ($filePointer, 0); + ftruncate($filePointer, 0); fwrite($filePointer, $content); fflush($filePointer); flock($filePointer, LOCK_UN); diff --git a/lib/private/Files/View.php b/lib/private/Files/View.php index 567af4d23a..881bf1a212 100644 --- a/lib/private/Files/View.php +++ b/lib/private/Files/View.php @@ -670,7 +670,7 @@ class View { list($storage, $internalPath) = $this->resolvePath($path); $target = $storage->fopen($internalPath, 'w'); if ($target) { - list (, $result) = \OC_Helper::streamCopy($data, $target); + list(, $result) = \OC_Helper::streamCopy($data, $target); fclose($target); fclose($data); diff --git a/lib/private/legacy/OC_Template.php b/lib/private/legacy/OC_Template.php index 99ad53fa08..ad1d31d80f 100644 --- a/lib/private/legacy/OC_Template.php +++ b/lib/private/legacy/OC_Template.php @@ -104,16 +104,16 @@ class OC_Template extends \OC\Template\Base { //apps that started before the template initialization can load their own scripts/styles //so to make sure this scripts/styles here are loaded first we use OC_Util::addScript() with $prepend=true //meaning the last script/style in this list will be loaded first - if (\OC::$server->getSystemConfig()->getValue ('installed', false) && $renderAs !== 'error' && !\OCP\Util::needUpgrade()) { - if (\OC::$server->getConfig ()->getAppValue ( 'core', 'backgroundjobs_mode', 'ajax' ) == 'ajax') { - OC_Util::addScript ( 'backgroundjobs', null, true ); + if (\OC::$server->getSystemConfig()->getValue('installed', false) && $renderAs !== 'error' && !\OCP\Util::needUpgrade()) { + if (\OC::$server->getConfig()->getAppValue( 'core', 'backgroundjobs_mode', 'ajax' ) == 'ajax') { + OC_Util::addScript( 'backgroundjobs', null, true ); } } OC_Util::addStyle('css-variables', null, true); OC_Util::addStyle('server', null, true); OC_Util::addTranslations('core', null, true); - if (\OC::$server->getSystemConfig()->getValue ('installed', false)) { + if (\OC::$server->getSystemConfig()->getValue('installed', false)) { OC_Util::addStyle('search', 'results'); OC_Util::addScript('search', 'search', true); OC_Util::addScript('search', 'searchprovider'); diff --git a/lib/private/legacy/OC_Util.php b/lib/private/legacy/OC_Util.php index 5d2f8b8370..378c393831 100644 --- a/lib/private/legacy/OC_Util.php +++ b/lib/private/legacy/OC_Util.php @@ -590,7 +590,7 @@ class OC_Util { // core js files need separate handling if ($application !== 'core' && $file !== null) { - self::addTranslations ( $application ); + self::addTranslations( $application ); } self::addExternalResource($application, $prepend, $path, "script"); } @@ -667,7 +667,7 @@ class OC_Util { if ($type === "style") { if (!in_array($path, self::$styles)) { if ($prepend === true) { - array_unshift ( self::$styles, $path ); + array_unshift( self::$styles, $path ); } else { self::$styles[] = $path; } @@ -675,7 +675,7 @@ class OC_Util { } elseif ($type === "script") { if (!in_array($path, self::$scripts)) { if ($prepend === true) { - array_unshift ( self::$scripts, $path ); + array_unshift( self::$scripts, $path ); } else { self::$scripts [] = $path; } @@ -699,7 +699,7 @@ class OC_Util { 'text' => $text ]; if ($prepend === true) { - array_unshift (self::$headers, $header); + array_unshift(self::$headers, $header); } else { self::$headers[] = $header; From 44577e4345066952622feca9ef69c24fc23d08ab Mon Sep 17 00:00:00 2001 From: Christoph Wurst Date: Thu, 9 Apr 2020 16:07:47 +0200 Subject: [PATCH 2/6] Remove trailing and in between spaces Signed-off-by: Christoph Wurst --- apps/comments/lib/EventHandler.php | 2 +- .../lib/Listener/LoadAdditionalScripts.php | 2 +- .../lib/Listener/LoadSidebarScripts.php | 2 +- apps/comments/lib/Notification/Listener.php | 4 +- apps/dav/lib/CardDAV/ImageExportPlugin.php | 2 +- apps/dav/lib/Command/MoveCalendar.php | 2 +- apps/dav/lib/Comments/CommentNode.php | 2 +- .../SystemTagsObjectTypeCollection.php | 2 +- .../unit/CalDAV/Schedule/IMipPluginTest.php | 6 +-- .../unit/SystemTag/SystemTagPluginTest.php | 6 +-- .../lib/Controller/StatusController.php | 2 +- apps/encryption/templates/altmail.php | 2 +- apps/encryption/templates/settings-admin.php | 2 +- .../templates/settings-personal.php | 32 ++++++------ .../Controller/MountPublicLinkController.php | 2 +- apps/files/templates/list.php | 4 +- apps/files/templates/simplelist.php | 4 +- apps/files_external/lib/Lib/Storage/FTP.php | 2 +- apps/files_external/lib/Lib/Storage/SFTP.php | 2 +- apps/files_external/templates/list.php | 2 +- .../Service/GlobalStoragesServiceTest.php | 2 +- .../tests/Storage/Amazons3Test.php | 2 +- apps/files_external/tests/Storage/FtpTest.php | 2 +- .../tests/Storage/OwncloudTest.php | 2 +- .../tests/Storage/SFTP_KeyTest.php | 2 +- .../lib/Controller/ShareController.php | 2 +- apps/files_sharing/templates/list.php | 6 +-- .../tests/Migration/SetPasswordColumnTest.php | 2 +- .../files_sharing/tests/MountProviderTest.php | 38 +++++++------- apps/files_trashbin/templates/index.php | 4 +- .../lib/Listener/LoadAdditionalListener.php | 2 +- .../lib/Listener/LoadSidebarListener.php | 2 +- apps/files_versions/lib/Storage.php | 4 +- .../lib/Controller/OauthApiController.php | 2 +- .../tests/Controller/GroupsControllerTest.php | 2 +- apps/settings/templates/help.php | 2 +- .../templates/settings/admin/overview.php | 2 +- .../templates/settings/admin/sharing.php | 8 +-- apps/settings/templates/settings/frame.php | 2 +- .../Controller/CheckSetupControllerTest.php | 2 +- apps/sharebymail/tests/CapabilitiesTest.php | 4 +- apps/systemtags/templates/list.php | 4 +- apps/theming/lib/ThemingDefaults.php | 4 +- apps/user_ldap/lib/Access.php | 6 +-- .../Controller/RenewPasswordController.php | 2 +- apps/user_ldap/lib/Helper.php | 2 +- apps/user_ldap/lib/LDAPProvider.php | 2 +- apps/user_ldap/lib/LDAPProviderFactory.php | 2 +- apps/user_ldap/lib/Migration/UUIDFixGroup.php | 2 +- apps/user_ldap/lib/User/Manager.php | 4 +- apps/user_ldap/lib/User/User.php | 6 +-- apps/user_ldap/templates/settings.php | 2 +- apps/user_ldap/tests/GroupLDAPPluginTest.php | 4 +- apps/user_ldap/tests/Group_LDAPTest.php | 2 +- apps/user_ldap/tests/Jobs/CleanUpTest.php | 2 +- apps/user_ldap/tests/UserLDAPPluginTest.php | 8 +-- .../features/bootstrap/Sharing.php | 4 +- build/license.php | 2 +- core/Command/Background/Base.php | 2 +- core/Command/Encryption/DecryptAll.php | 2 +- core/Command/Encryption/EncryptAll.php | 2 +- core/Controller/SetupController.php | 4 +- core/templates/403.php | 2 +- core/templates/installation.php | 52 +++++++++---------- core/templates/layout.guest.php | 2 +- core/templates/layout.user.php | 4 +- core/templates/update.admin.php | 2 +- core/templates/update.use-cli.php | 4 +- lib/base.php | 2 +- lib/private/AppFramework/Http.php | 8 +-- lib/private/Avatar/Avatar.php | 2 +- .../Collaborators/RemotePlugin.php | 2 +- lib/private/DB/AdapterPgSql.php | 4 +- lib/private/DB/AdapterSqlite.php | 6 +-- lib/private/DB/Connection.php | 2 +- lib/private/Encryption/Util.php | 2 +- .../ObjectStore/HomeObjectStoreStorage.php | 2 +- lib/private/Group/Database.php | 4 +- lib/private/Installer.php | 14 ++--- lib/private/L10N/Factory.php | 12 ++--- lib/private/Search.php | 4 +- lib/private/Share/Share.php | 6 +-- lib/private/Tags.php | 6 +-- lib/private/Template/Base.php | 8 +-- lib/private/TemplateLayout.php | 24 ++++----- lib/private/URLGenerator.php | 2 +- lib/private/User/Backend.php | 2 +- lib/private/User/Session.php | 2 +- lib/private/User/User.php | 2 +- lib/private/legacy/OC_DB.php | 6 +-- lib/private/legacy/OC_Hook.php | 12 ++--- lib/private/legacy/OC_JSON.php | 12 ++--- lib/private/legacy/OC_Response.php | 6 +-- lib/private/legacy/OC_Template.php | 32 ++++++------ lib/private/legacy/OC_Util.php | 10 ++-- lib/private/legacy/template/functions.php | 6 +-- lib/public/App.php | 8 +-- lib/public/AppFramework/Db/Mapper.php | 2 +- lib/public/AppFramework/Db/QBMapper.php | 2 +- lib/public/Files.php | 6 +-- lib/public/Util.php | 4 +- remote.php | 2 +- .../ClientFlowLoginControllerTest.php | 2 +- .../features/bootstrap/AppSettingsContext.php | 2 +- tests/lib/App/DependencyAnalyzerTest.php | 14 ++--- .../Http/RedirectResponseTest.php | 2 +- tests/lib/AutoLoaderTest.php | 4 +- tests/lib/DB/DBSchemaTest.php | 12 ++--- tests/lib/DB/LegacyDBTest.php | 6 +-- tests/lib/DB/SchemaDiffTest.php | 2 +- tests/lib/Files/Stream/EncryptionTest.php | 2 +- tests/lib/Log/FileTest.php | 2 +- tests/lib/Preview/HEICTest.php | 2 +- tests/lib/SubAdminTest.php | 2 +- tests/lib/TestCase.php | 4 +- 115 files changed, 296 insertions(+), 296 deletions(-) diff --git a/apps/comments/lib/EventHandler.php b/apps/comments/lib/EventHandler.php index 62202cc850..4364550a22 100644 --- a/apps/comments/lib/EventHandler.php +++ b/apps/comments/lib/EventHandler.php @@ -55,7 +55,7 @@ class EventHandler implements ICommentsEventHandler { } $eventType = $event->getEvent(); - if( $eventType === CommentsEvent::EVENT_ADD + if($eventType === CommentsEvent::EVENT_ADD ) { $this->notificationHandler($event); $this->activityHandler($event); diff --git a/apps/comments/lib/Listener/LoadAdditionalScripts.php b/apps/comments/lib/Listener/LoadAdditionalScripts.php index 764e48c582..ddaf288394 100644 --- a/apps/comments/lib/Listener/LoadAdditionalScripts.php +++ b/apps/comments/lib/Listener/LoadAdditionalScripts.php @@ -39,7 +39,7 @@ class LoadAdditionalScripts implements IEventListener { return; } - // TODO: make sure to only include the sidebar script when + // TODO: make sure to only include the sidebar script when // we properly split it between files list and sidebar Util::addScript(Application::APP_ID, 'comments'); } diff --git a/apps/comments/lib/Listener/LoadSidebarScripts.php b/apps/comments/lib/Listener/LoadSidebarScripts.php index b27da57a16..209c62dc40 100644 --- a/apps/comments/lib/Listener/LoadSidebarScripts.php +++ b/apps/comments/lib/Listener/LoadSidebarScripts.php @@ -38,7 +38,7 @@ class LoadSidebarScripts implements IEventListener { return; } - // TODO: make sure to only include the sidebar script when + // TODO: make sure to only include the sidebar script when // we properly split it between files list and sidebar Util::addScript(Application::APP_ID, 'comments'); } diff --git a/apps/comments/lib/Notification/Listener.php b/apps/comments/lib/Notification/Listener.php index 3acdce4e47..ba645ac577 100644 --- a/apps/comments/lib/Notification/Listener.php +++ b/apps/comments/lib/Notification/Listener.php @@ -65,7 +65,7 @@ class Listener { $notification = $this->instantiateNotification($comment); foreach($mentions as $uid) { - if( ($comment->getActorType() === 'users' && $uid === $comment->getActorId()) + if(($comment->getActorType() === 'users' && $uid === $comment->getActorId()) || !$this->userManager->userExists($uid) ) { // do not notify unknown users or yourself @@ -73,7 +73,7 @@ class Listener { } $notification->setUser($uid); - if( $event->getEvent() === CommentsEvent::EVENT_DELETE + if($event->getEvent() === CommentsEvent::EVENT_DELETE || $event->getEvent() === CommentsEvent::EVENT_PRE_UPDATE) { $this->notificationManager->markProcessed($notification); diff --git a/apps/dav/lib/CardDAV/ImageExportPlugin.php b/apps/dav/lib/CardDAV/ImageExportPlugin.php index 396d847d88..74faa5d7df 100644 --- a/apps/dav/lib/CardDAV/ImageExportPlugin.php +++ b/apps/dav/lib/CardDAV/ImageExportPlugin.php @@ -97,7 +97,7 @@ class ImageExportPlugin extends ServerPlugin { $addressbook = $this->server->tree->getNodeForPath($addressbookpath); $response->setHeader('Cache-Control', 'private, max-age=3600, must-revalidate'); - $response->setHeader('Etag', $node->getETag() ); + $response->setHeader('Etag', $node->getETag()); $response->setHeader('Pragma', 'public'); try { diff --git a/apps/dav/lib/Command/MoveCalendar.php b/apps/dav/lib/Command/MoveCalendar.php index 9efd63722d..8399fb5ed3 100644 --- a/apps/dav/lib/Command/MoveCalendar.php +++ b/apps/dav/lib/Command/MoveCalendar.php @@ -180,7 +180,7 @@ class MoveCalendar extends Command { */ if (count($shares) > 0) { $this->io->note([ - "Please note that moving calendar " . $calendar['uri'] . " from user <$userOrigin> to <$userDestination> has caused share links to change.", + "Please note that moving calendar " . $calendar['uri'] . " from user <$userOrigin> to <$userDestination> has caused share links to change.", "Sharees will need to change \"example.com/remote.php/dav/calendars/uid/" . $calendar['uri'] . "_shared_by_$userOrigin\" to \"example.com/remote.php/dav/calendars/uid/" . $calendar['uri'] . "_shared_by_$userDestination\"" ]); } diff --git a/apps/dav/lib/Comments/CommentNode.php b/apps/dav/lib/Comments/CommentNode.php index d54f81b7a8..d24c41409b 100644 --- a/apps/dav/lib/Comments/CommentNode.php +++ b/apps/dav/lib/Comments/CommentNode.php @@ -131,7 +131,7 @@ class CommentNode implements \Sabre\DAV\INode, \Sabre\DAV\IProperties { protected function checkWriteAccessOnComment() { $user = $this->userSession->getUser(); - if( $this->comment->getActorType() !== 'users' + if($this->comment->getActorType() !== 'users' || is_null($user) || $this->comment->getActorId() !== $user->getUID() ) { diff --git a/apps/dav/lib/SystemTag/SystemTagsObjectTypeCollection.php b/apps/dav/lib/SystemTag/SystemTagsObjectTypeCollection.php index ca9a72b6a9..ff0409c7ea 100644 --- a/apps/dav/lib/SystemTag/SystemTagsObjectTypeCollection.php +++ b/apps/dav/lib/SystemTag/SystemTagsObjectTypeCollection.php @@ -80,7 +80,7 @@ class SystemTagsObjectTypeCollection implements ICollection { * @param \Closure $childExistsFunction */ public function __construct( - $objectType, + $objectType, ISystemTagManager $tagManager, ISystemTagObjectMapper $tagMapper, IUserSession $userSession, diff --git a/apps/dav/tests/unit/CalDAV/Schedule/IMipPluginTest.php b/apps/dav/tests/unit/CalDAV/Schedule/IMipPluginTest.php index 53e1b8d0c8..a666aec95a 100644 --- a/apps/dav/tests/unit/CalDAV/Schedule/IMipPluginTest.php +++ b/apps/dav/tests/unit/CalDAV/Schedule/IMipPluginTest.php @@ -192,7 +192,7 @@ class IMipPluginTest extends TestCase { ->with('dav', 'invitation_link_recipients', 'yes') ->willReturn('yes'); - $message = $this->_testMessage( $veventParams ); + $message = $this->_testMessage($veventParams); $this->_expectSend('frodo@hobb.it', $expectsMail, $expectsMail); @@ -274,8 +274,8 @@ class IMipPluginTest extends TestCase { 'SUMMARY' => 'Fellowship meeting', 'DTSTART' => new \DateTime('2018-01-01 00:00:00') ], $attrs)); - $message->message->VEVENT->add( 'ORGANIZER', 'mailto:gandalf@wiz.ard' ); - $message->message->VEVENT->add( 'ATTENDEE', 'mailto:'.$recipient, [ 'RSVP' => 'TRUE' ] ); + $message->message->VEVENT->add('ORGANIZER', 'mailto:gandalf@wiz.ard'); + $message->message->VEVENT->add('ATTENDEE', 'mailto:'.$recipient, [ 'RSVP' => 'TRUE' ]); $message->sender = 'mailto:gandalf@wiz.ard'; $message->senderName = 'Mr. Wizard'; $message->recipient = 'mailto:'.$recipient; diff --git a/apps/dav/tests/unit/SystemTag/SystemTagPluginTest.php b/apps/dav/tests/unit/SystemTag/SystemTagPluginTest.php index 24fc561cd9..ec80d916b5 100644 --- a/apps/dav/tests/unit/SystemTag/SystemTagPluginTest.php +++ b/apps/dav/tests/unit/SystemTag/SystemTagPluginTest.php @@ -573,7 +573,7 @@ class SystemTagPluginTest extends \Test\TestCase { $request->expects($this->once()) ->method('getHeader') ->with('Content-Type') - ->willReturn('application/json'); + ->willReturn('application/json'); $request->expects($this->once()) ->method('getUrl') @@ -647,7 +647,7 @@ class SystemTagPluginTest extends \Test\TestCase { $request->expects($this->once()) ->method('getHeader') ->with('Content-Type') - ->willReturn('application/json'); + ->willReturn('application/json'); $request->expects($this->once()) ->method('getBaseUrl') @@ -744,7 +744,7 @@ class SystemTagPluginTest extends \Test\TestCase { $request->expects($this->once()) ->method('getHeader') ->with('Content-Type') - ->willReturn('application/json'); + ->willReturn('application/json'); $this->plugin->httpPost($request, $response); } diff --git a/apps/encryption/lib/Controller/StatusController.php b/apps/encryption/lib/Controller/StatusController.php index fdd6de78e7..d3925e4482 100644 --- a/apps/encryption/lib/Controller/StatusController.php +++ b/apps/encryption/lib/Controller/StatusController.php @@ -70,7 +70,7 @@ class StatusController extends Controller { $status = 'error'; $message = 'no valid init status'; - switch( $this->session->getStatus()) { + switch($this->session->getStatus()) { case Session::INIT_EXECUTED: $status = 'interactionNeeded'; $message = (string)$this->l->t( diff --git a/apps/encryption/templates/altmail.php b/apps/encryption/templates/altmail.php index dde85e0af1..bea416f05f 100644 --- a/apps/encryption/templates/altmail.php +++ b/apps/encryption/templates/altmail.php @@ -3,7 +3,7 @@ /** @var array $_ */ print_unescaped($l->t("Hey there,\n\nthe admin enabled server-side-encryption. Your files were encrypted using the password '%s'.\n\nPlease login to the web interface, go to the section 'basic encryption module' of your personal settings and update your encryption password by entering this password into the 'old log-in password' field and your current login-password.\n\n", [$_['password']])); -if ( isset($_['expiration']) ) { +if (isset($_['expiration'])) { print_unescaped($l->t("The share will expire on %s.", [$_['expiration']])); print_unescaped("\n\n"); } diff --git a/apps/encryption/templates/settings-admin.php b/apps/encryption/templates/settings-admin.php index 39d10490c4..48cc4d40da 100644 --- a/apps/encryption/templates/settings-admin.php +++ b/apps/encryption/templates/settings-admin.php @@ -13,7 +13,7 @@ style('encryption', 'settings-admin'); />
- t( "Enabling this option encrypts all files stored on the main storage, otherwise only files on external storage will be encrypted" ) ); ?> + t("Enabling this option encrypts all files stored on the main storage, otherwise only files on external storage will be encrypted")); ?>


diff --git a/apps/encryption/templates/settings-personal.php b/apps/encryption/templates/settings-personal.php index 47860b2f20..23886b7c82 100644 --- a/apps/encryption/templates/settings-personal.php +++ b/apps/encryption/templates/settings-personal.php @@ -6,49 +6,49 @@ script('encryption', 'settings-personal');

t('Basic encryption module')); ?>

- + t("Encryption App is enabled, but your keys are not initialized. Please log-out and log-in again.")); ?> - +


- t( "Set your old private key password to your current log-in password:" ) ); ?> - t( " If you don't remember your old password you can ask your administrator to recover your files." ) ); + t("Set your old private key password to your current log-in password:")); ?> + t(" If you don't remember your old password you can ask your administrator to recover your files.")); endif; ?>
- +
- +

- +

- +
- t( "Enabling this option will allow you to reobtain access to your encrypted files in case of password loss" ) ); ?> + t("Enabling this option will allow you to reobtain access to your encrypted files in case of password loss")); ?>
/> - + /> +
/> - + /> +

diff --git a/apps/federatedfilesharing/lib/Controller/MountPublicLinkController.php b/apps/federatedfilesharing/lib/Controller/MountPublicLinkController.php index bf2948b0f6..b46fab1944 100644 --- a/apps/federatedfilesharing/lib/Controller/MountPublicLinkController.php +++ b/apps/federatedfilesharing/lib/Controller/MountPublicLinkController.php @@ -146,7 +146,7 @@ class MountPublicLinkController extends Controller { $storedPassword = $share->getPassword(); $authenticated = $this->session->get('public_link_authenticated') === $share->getId() || $this->shareManager->checkPassword($share, $password); - if (!empty($storedPassword) && !$authenticated ) { + if (!empty($storedPassword) && !$authenticated) { $response = new JSONResponse( ['message' => 'No permission to access the share'], Http::STATUS_BAD_REQUEST diff --git a/apps/files/templates/list.php b/apps/files/templates/list.php index 697a0a9cf4..ff23c1aee9 100644 --- a/apps/files/templates/list.php +++ b/apps/files/templates/list.php @@ -44,7 +44,7 @@
- t( 'Name' )); ?> + t('Name')); ?> @@ -60,7 +60,7 @@ t('Size')); ?> - t( 'Modified' )); ?> + t('Modified')); ?> diff --git a/apps/files/templates/simplelist.php b/apps/files/templates/simplelist.php index 9fd9c49c9c..ee07cd0955 100644 --- a/apps/files/templates/simplelist.php +++ b/apps/files/templates/simplelist.php @@ -18,14 +18,14 @@ t('Size')); ?> - t( 'Modified' )); ?> + t('Modified')); ?> secure = false; } $this->root=isset($params['root'])?$params['root']:'/'; - if ( ! $this->root || $this->root[0]!=='/') { + if (! $this->root || $this->root[0]!=='/') { $this->root='/'.$this->root; } if (substr($this->root, -1) !== '/') { diff --git a/apps/files_external/lib/Lib/Storage/SFTP.php b/apps/files_external/lib/Lib/Storage/SFTP.php index acc4042f21..ee848889c3 100644 --- a/apps/files_external/lib/Lib/Storage/SFTP.php +++ b/apps/files_external/lib/Lib/Storage/SFTP.php @@ -371,7 +371,7 @@ class SFTP extends \OC\Files\Storage\Common { switch($mode) { case 'r': case 'rb': - if ( !$this->file_exists($path)) { + if (!$this->file_exists($path)) { return false; } SFTPReadStream::register(); diff --git a/apps/files_external/templates/list.php b/apps/files_external/templates/list.php index 04b7159cfe..e1b666c14c 100644 --- a/apps/files_external/templates/list.php +++ b/apps/files_external/templates/list.php @@ -16,7 +16,7 @@ diff --git a/apps/files_external/tests/Service/GlobalStoragesServiceTest.php b/apps/files_external/tests/Service/GlobalStoragesServiceTest.php index 947e1fd60e..bc831b1e95 100644 --- a/apps/files_external/tests/Service/GlobalStoragesServiceTest.php +++ b/apps/files_external/tests/Service/GlobalStoragesServiceTest.php @@ -267,7 +267,7 @@ class GlobalStoragesServiceTest extends StoragesServiceTest { ], ], ], - // mixed groups and users + // mixed groups and users [ ['user1', 'user2'], ['group1', 'group2'], diff --git a/apps/files_external/tests/Storage/Amazons3Test.php b/apps/files_external/tests/Storage/Amazons3Test.php index 0137ff919f..0e9ec3dbaa 100644 --- a/apps/files_external/tests/Storage/Amazons3Test.php +++ b/apps/files_external/tests/Storage/Amazons3Test.php @@ -45,7 +45,7 @@ class Amazons3Test extends \Test\Files\Storage\Storage { parent::setUp(); $this->config = include('files_external/tests/config.amazons3.php'); - if ( ! is_array($this->config) or ! $this->config['run']) { + if (! is_array($this->config) or ! $this->config['run']) { $this->markTestSkipped('AmazonS3 backend not configured'); } $this->instance = new AmazonS3($this->config); diff --git a/apps/files_external/tests/Storage/FtpTest.php b/apps/files_external/tests/Storage/FtpTest.php index c4c947d608..904b46c283 100644 --- a/apps/files_external/tests/Storage/FtpTest.php +++ b/apps/files_external/tests/Storage/FtpTest.php @@ -47,7 +47,7 @@ class FtpTest extends \Test\Files\Storage\Storage { $id = $this->getUniqueID(); $this->config = include('files_external/tests/config.ftp.php'); - if ( ! is_array($this->config) or ! $this->config['run']) { + if (! is_array($this->config) or ! $this->config['run']) { $this->markTestSkipped('FTP backend not configured'); } $this->config['root'] .= '/' . $id; //make sure we have an new empty folder to work in diff --git a/apps/files_external/tests/Storage/OwncloudTest.php b/apps/files_external/tests/Storage/OwncloudTest.php index 80c5425dd3..0f63709614 100644 --- a/apps/files_external/tests/Storage/OwncloudTest.php +++ b/apps/files_external/tests/Storage/OwncloudTest.php @@ -45,7 +45,7 @@ class OwncloudTest extends \Test\Files\Storage\Storage { $id = $this->getUniqueID(); $this->config = include('files_external/tests/config.php'); - if ( ! is_array($this->config) or ! isset($this->config['owncloud']) or ! $this->config['owncloud']['run']) { + if (! is_array($this->config) or ! isset($this->config['owncloud']) or ! $this->config['owncloud']['run']) { $this->markTestSkipped('Nextcloud backend not configured'); } $this->config['owncloud']['root'] .= '/' . $id; //make sure we have an new empty folder to work in diff --git a/apps/files_external/tests/Storage/SFTP_KeyTest.php b/apps/files_external/tests/Storage/SFTP_KeyTest.php index b1ae0fc2a8..b60e0f8ec5 100644 --- a/apps/files_external/tests/Storage/SFTP_KeyTest.php +++ b/apps/files_external/tests/Storage/SFTP_KeyTest.php @@ -44,7 +44,7 @@ class SFTP_KeyTest extends \Test\Files\Storage\Storage { $id = $this->getUniqueID(); $this->config = include('files_external/tests/config.php'); - if ( ! is_array($this->config) or ! isset($this->config['sftp_key']) or ! $this->config['sftp_key']['run']) { + if (! is_array($this->config) or ! isset($this->config['sftp_key']) or ! $this->config['sftp_key']['run']) { $this->markTestSkipped('SFTP with key backend not configured'); } // Make sure we have an new empty folder to work in diff --git a/apps/files_sharing/lib/Controller/ShareController.php b/apps/files_sharing/lib/Controller/ShareController.php index 1cf798c975..48914e2777 100644 --- a/apps/files_sharing/lib/Controller/ShareController.php +++ b/apps/files_sharing/lib/Controller/ShareController.php @@ -425,7 +425,7 @@ class ShareController extends AuthPublicShareController { $shareTmpl['previewURL'] = $shareTmpl['downloadURL']; if ($shareTmpl['previewSupported']) { - $shareTmpl['previewImage'] = $this->urlGenerator->linkToRouteAbsolute( 'files_sharing.PublicPreview.getPreview', + $shareTmpl['previewImage'] = $this->urlGenerator->linkToRouteAbsolute('files_sharing.PublicPreview.getPreview', ['x' => 200, 'y' => 200, 'file' => $shareTmpl['directory_path'], 'token' => $shareTmpl['dirToken']]); $ogPreview = $shareTmpl['previewImage']; diff --git a/apps/files_sharing/templates/list.php b/apps/files_sharing/templates/list.php index 95ba9160a9..03c097725a 100644 --- a/apps/files_sharing/templates/list.php +++ b/apps/files_sharing/templates/list.php @@ -15,14 +15,14 @@ - t( 'Share time' )); ?> + t('Share time')); ?> - t( 'Expiration date' )); ?> + t('Expiration date')); ?> diff --git a/apps/files_sharing/tests/Migration/SetPasswordColumnTest.php b/apps/files_sharing/tests/Migration/SetPasswordColumnTest.php index cf50902d03..b2f5fd7c85 100644 --- a/apps/files_sharing/tests/Migration/SetPasswordColumnTest.php +++ b/apps/files_sharing/tests/Migration/SetPasswordColumnTest.php @@ -109,7 +109,7 @@ class SetPasswordColumnTest extends TestCase { foreach ($allShares as $share) { if ((int)$share['share_type'] === Share::SHARE_TYPE_LINK) { - $this->assertNull( $share['share_with']); + $this->assertNull($share['share_with']); $this->assertSame('shareWith', $share['password']); } else { $this->assertSame('shareWith', $share['share_with']); diff --git a/apps/files_sharing/tests/MountProviderTest.php b/apps/files_sharing/tests/MountProviderTest.php index cd1afb1f6f..ec52db8542 100644 --- a/apps/files_sharing/tests/MountProviderTest.php +++ b/apps/files_sharing/tests/MountProviderTest.php @@ -112,9 +112,9 @@ class MountProviderTest extends \Test\TestCase { $this->makeMockShare(2, 100, 'user2', '/share2', 31), ]; $groupShares = [ - $this->makeMockShare(3, 100, 'user2', '/share2', 0), - $this->makeMockShare(4, 101, 'user2', '/share4', 31), - $this->makeMockShare(5, 100, 'user1', '/share4', 31), + $this->makeMockShare(3, 100, 'user2', '/share2', 0), + $this->makeMockShare(4, 101, 'user2', '/share4', 31), + $this->makeMockShare(5, 100, 'user1', '/share4', 31), ]; $roomShares = [ $this->makeMockShare(6, 102, 'user2', '/share6', 0), @@ -180,10 +180,10 @@ class MountProviderTest extends \Test\TestCase { // #0: share as outsider with "group1" and "user1" with same permissions [ [ - [1, 100, 'user2', '/share2', 31], + [1, 100, 'user2', '/share2', 31], ], [ - [2, 100, 'user2', '/share2', 31], + [2, 100, 'user2', '/share2', 31], ], [ // combined, user share has higher priority @@ -193,10 +193,10 @@ class MountProviderTest extends \Test\TestCase { // #1: share as outsider with "group1" and "user1" with different permissions [ [ - [1, 100, 'user2', '/share', 31], + [1, 100, 'user2', '/share', 31], ], [ - [2, 100, 'user2', '/share', 15], + [2, 100, 'user2', '/share', 15], ], [ // use highest permissions @@ -208,8 +208,8 @@ class MountProviderTest extends \Test\TestCase { [ ], [ - [1, 100, 'user2', '/share', 31], - [2, 100, 'user2', '/share', 31], + [1, 100, 'user2', '/share', 31], + [2, 100, 'user2', '/share', 31], ], [ // combined, first group share has higher priority @@ -221,8 +221,8 @@ class MountProviderTest extends \Test\TestCase { [ ], [ - [1, 100, 'user2', '/share', 31], - [2, 100, 'user2', '/share', 15], + [1, 100, 'user2', '/share', 31], + [2, 100, 'user2', '/share', 15], ], [ // use higher permissions @@ -234,7 +234,7 @@ class MountProviderTest extends \Test\TestCase { [ ], [ - [1, 100, 'user1', '/share', 31], + [1, 100, 'user1', '/share', 31], ], [ // no received share since "user1" is the sharer/owner @@ -245,8 +245,8 @@ class MountProviderTest extends \Test\TestCase { [ ], [ - [1, 100, 'user1', '/share', 31], - [2, 100, 'user1', '/share', 15], + [1, 100, 'user1', '/share', 31], + [2, 100, 'user1', '/share', 15], ], [ // no received share since "user1" is the sharer/owner @@ -257,7 +257,7 @@ class MountProviderTest extends \Test\TestCase { [ ], [ - [1, 100, 'user2', '/share', 0], + [1, 100, 'user2', '/share', 0], ], [ // no received share since "user1" opted out @@ -266,10 +266,10 @@ class MountProviderTest extends \Test\TestCase { // #7: share as outsider with "group1" and "user1" where recipient renamed in between [ [ - [1, 100, 'user2', '/share2-renamed', 31], + [1, 100, 'user2', '/share2-renamed', 31], ], [ - [2, 100, 'user2', '/share2', 31], + [2, 100, 'user2', '/share2', 31], ], [ // use target of least recent share @@ -279,10 +279,10 @@ class MountProviderTest extends \Test\TestCase { // #8: share as outsider with "group1" and "user1" where recipient renamed in between [ [ - [2, 100, 'user2', '/share2', 31], + [2, 100, 'user2', '/share2', 31], ], [ - [1, 100, 'user2', '/share2-renamed', 31], + [1, 100, 'user2', '/share2-renamed', 31], ], [ // use target of least recent share diff --git a/apps/files_trashbin/templates/index.php b/apps/files_trashbin/templates/index.php index e503e364af..2bf4be54f6 100644 --- a/apps/files_trashbin/templates/index.php +++ b/apps/files_trashbin/templates/index.php @@ -29,7 +29,7 @@ - t( 'Deleted' )); ?> + t('Deleted')); ?> diff --git a/apps/files_versions/lib/Listener/LoadAdditionalListener.php b/apps/files_versions/lib/Listener/LoadAdditionalListener.php index 0d8c380915..f6d6734107 100644 --- a/apps/files_versions/lib/Listener/LoadAdditionalListener.php +++ b/apps/files_versions/lib/Listener/LoadAdditionalListener.php @@ -39,7 +39,7 @@ class LoadAdditionalListener implements IEventListener { return; } - // TODO: make sure to only include the sidebar script when + // TODO: make sure to only include the sidebar script when // we properly split it between files list and sidebar Util::addScript(Application::APP_ID, 'files_versions'); } diff --git a/apps/files_versions/lib/Listener/LoadSidebarListener.php b/apps/files_versions/lib/Listener/LoadSidebarListener.php index ac877620e7..875fe8b3fc 100644 --- a/apps/files_versions/lib/Listener/LoadSidebarListener.php +++ b/apps/files_versions/lib/Listener/LoadSidebarListener.php @@ -39,7 +39,7 @@ class LoadSidebarListener implements IEventListener { return; } - // TODO: make sure to only include the sidebar script when + // TODO: make sure to only include the sidebar script when // we properly split it between files list and sidebar Util::addScript(Application::APP_ID, 'files_versions'); } diff --git a/apps/files_versions/lib/Storage.php b/apps/files_versions/lib/Storage.php index 1c4e424ec7..8150089c07 100644 --- a/apps/files_versions/lib/Storage.php +++ b/apps/files_versions/lib/Storage.php @@ -107,7 +107,7 @@ class Storage { $uid = User::getUser(); } Filesystem::initMountPoints($uid); - if ( $uid !== User::getUser() ) { + if ($uid !== User::getUser()) { $info = Filesystem::getFileInfo($filename); $ownerView = new View('/'.$uid.'/files'); try { @@ -735,7 +735,7 @@ class Storage { $softQuota = true; $quota = $user->getQuota(); - if ( $quota === null || $quota === 'none' ) { + if ($quota === null || $quota === 'none') { $quota = Filesystem::free_space('/'); $softQuota = false; } else { diff --git a/apps/oauth2/lib/Controller/OauthApiController.php b/apps/oauth2/lib/Controller/OauthApiController.php index 6e12132ed0..91dd1b948c 100644 --- a/apps/oauth2/lib/Controller/OauthApiController.php +++ b/apps/oauth2/lib/Controller/OauthApiController.php @@ -99,7 +99,7 @@ class OauthApiController extends Controller { } // We handle the initial and refresh tokens the same way - if ($grant_type === 'refresh_token' ) { + if ($grant_type === 'refresh_token') { $code = $refresh_token; } diff --git a/apps/provisioning_api/tests/Controller/GroupsControllerTest.php b/apps/provisioning_api/tests/Controller/GroupsControllerTest.php index 0469fee0f7..70a920b743 100644 --- a/apps/provisioning_api/tests/Controller/GroupsControllerTest.php +++ b/apps/provisioning_api/tests/Controller/GroupsControllerTest.php @@ -249,7 +249,7 @@ class GroupsControllerTest extends \Test\TestCase { 'disabled' => 11, 'canAdd' => true, 'canRemove' => true - ], + ], [ 'id' => 'group2', 'displayname' => 'group2-name', diff --git a/apps/settings/templates/help.php b/apps/settings/templates/help.php index 02e84052ff..0eccf78cc9 100644 --- a/apps/settings/templates/help.php +++ b/apps/settings/templates/help.php @@ -1,5 +1,5 @@
    diff --git a/apps/settings/templates/settings/admin/overview.php b/apps/settings/templates/settings/admin/overview.php index 5b36f840ad..9eb6fc1c1f 100644 --- a/apps/settings/templates/settings/admin/overview.php +++ b/apps/settings/templates/settings/admin/overview.php @@ -51,7 +51,7 @@

diff --git a/apps/settings/templates/settings/admin/sharing.php b/apps/settings/templates/settings/admin/sharing.php index c7f3ff16b7..0cfbb3e849 100644 --- a/apps/settings/templates/settings/admin/sharing.php +++ b/apps/settings/templates/settings/admin/sharing.php @@ -44,10 +44,10 @@

- t( 'Expire after ' )); ?> + t('Expire after ')); ?> ' /> - t( 'days' )); ?> + t('days')); ?> />
@@ -76,10 +76,10 @@

- t( 'Expire after ' )); ?> + t('Expire after ')); ?> ' /> - t( 'days' )); ?> + t('days')); ?> />
diff --git a/apps/settings/templates/settings/frame.php b/apps/settings/templates/settings/frame.php index e32c4ed2fc..d6658e9c63 100644 --- a/apps/settings/templates/settings/frame.php +++ b/apps/settings/templates/settings/frame.php @@ -22,7 +22,7 @@ */ style('settings', 'settings'); -script('settings', [ 'settings', 'admin', 'log', 'certificates'] ); +script('settings', [ 'settings', 'admin', 'log', 'certificates']); script('core', 'setupchecks'); script('files', 'jquery.fileupload'); diff --git a/apps/settings/tests/Controller/CheckSetupControllerTest.php b/apps/settings/tests/Controller/CheckSetupControllerTest.php index f00be40b24..86acf8acce 100644 --- a/apps/settings/tests/Controller/CheckSetupControllerTest.php +++ b/apps/settings/tests/Controller/CheckSetupControllerTest.php @@ -970,7 +970,7 @@ class CheckSetupControllerTest extends TestCase { $this->checker ->expects($this->once()) ->method('getResults') - ->willReturn( [ 'core' => [ 'EXTRA_FILE' => ['/testfile' => []], 'INVALID_HASH' => [ '/.idea/workspace.xml' => [ 'expected' => 'f1c5e2630d784bc9cb02d5a28f55d6f24d06dae2a0fee685f3c2521b050955d9d452769f61454c9ddfa9c308146ade10546cfa829794448eaffbc9a04a29d216', 'current' => 'ce08bf30bcbb879a18b49239a9bec6b8702f52452f88a9d32142cad8d2494d5735e6bfa0d8642b2762c62ca5be49f9bf4ec231d4a230559d4f3e2c471d3ea094', ], '/lib/private/integritycheck/checker.php' => [ 'expected' => 'c5a03bacae8dedf8b239997901ba1fffd2fe51271d13a00cc4b34b09cca5176397a89fc27381cbb1f72855fa18b69b6f87d7d5685c3b45aee373b09be54742ea', 'current' => '88a3a92c11db91dec1ac3be0e1c87f862c95ba6ffaaaa3f2c3b8f682187c66f07af3a3b557a868342ef4a271218fe1c1e300c478e6c156c5955ed53c40d06585', ], '/settings/controller/checksetupcontroller.php' => [ 'expected' => '3e1de26ce93c7bfe0ede7c19cb6c93cadc010340225b375607a7178812e9de163179b0dc33809f451e01f491d93f6f5aaca7929685d21594cccf8bda732327c4', 'current' => '09563164f9904a837f9ca0b5f626db56c838e5098e0ccc1d8b935f68fa03a25c5ec6f6b2d9e44a868e8b85764dafd1605522b4af8db0ae269d73432e9a01e63a', ], ], ], 'bookmarks' => [ 'EXCEPTION' => [ 'class' => 'OC\\IntegrityCheck\\Exceptions\\InvalidSignatureException', 'message' => 'Signature data not found.', ], ], 'dav' => [ 'EXCEPTION' => [ 'class' => 'OC\\IntegrityCheck\\Exceptions\\InvalidSignatureException', 'message' => 'Signature data not found.', ], ], 'encryption' => [ 'EXCEPTION' => [ 'class' => 'OC\\IntegrityCheck\\Exceptions\\InvalidSignatureException', 'message' => 'Signature data not found.', ], ], 'external' => [ 'EXCEPTION' => [ 'class' => 'OC\\IntegrityCheck\\Exceptions\\InvalidSignatureException', 'message' => 'Signature data not found.', ], ], 'federation' => [ 'EXCEPTION' => [ 'class' => 'OC\\IntegrityCheck\\Exceptions\\InvalidSignatureException', 'message' => 'Signature data not found.', ], ], 'files' => [ 'EXCEPTION' => [ 'class' => 'OC\\IntegrityCheck\\Exceptions\\InvalidSignatureException', 'message' => 'Signature data not found.', ], ], 'files_antivirus' => [ 'EXCEPTION' => [ 'class' => 'OC\\IntegrityCheck\\Exceptions\\InvalidSignatureException', 'message' => 'Signature data not found.', ], ], 'files_drop' => [ 'EXCEPTION' => [ 'class' => 'OC\\IntegrityCheck\\Exceptions\\InvalidSignatureException', 'message' => 'Signature data not found.', ], ], 'files_external' => [ 'EXCEPTION' => [ 'class' => 'OC\\IntegrityCheck\\Exceptions\\InvalidSignatureException', 'message' => 'Signature data not found.', ], ], 'files_pdfviewer' => [ 'EXCEPTION' => [ 'class' => 'OC\\IntegrityCheck\\Exceptions\\InvalidSignatureException', 'message' => 'Signature data not found.', ], ], 'files_sharing' => [ 'EXCEPTION' => [ 'class' => 'OC\\IntegrityCheck\\Exceptions\\InvalidSignatureException', 'message' => 'Signature data not found.', ], ], 'files_trashbin' => [ 'EXCEPTION' => [ 'class' => 'OC\\IntegrityCheck\\Exceptions\\InvalidSignatureException', 'message' => 'Signature data not found.', ], ], 'files_versions' => [ 'EXCEPTION' => [ 'class' => 'OC\\IntegrityCheck\\Exceptions\\InvalidSignatureException', 'message' => 'Signature data not found.', ], ], 'files_videoviewer' => [ 'EXCEPTION' => [ 'class' => 'OC\\IntegrityCheck\\Exceptions\\InvalidSignatureException', 'message' => 'Signature data not found.', ], ], 'firstrunwizard' => [ 'EXCEPTION' => [ 'class' => 'OC\\IntegrityCheck\\Exceptions\\InvalidSignatureException', 'message' => 'Signature data not found.', ], ], 'gitsmart' => [ 'EXCEPTION' => [ 'class' => 'OC\\IntegrityCheck\\Exceptions\\InvalidSignatureException', 'message' => 'Signature data not found.', ], ], 'logreader' => [ 'EXCEPTION' => [ 'class' => 'OC\\IntegrityCheck\\Exceptions\\InvalidSignatureException', 'message' => 'Signature could not get verified.', ], ], 'password_policy' => [ 'EXCEPTION' => [ 'class' => 'OC\\IntegrityCheck\\Exceptions\\InvalidSignatureException', 'message' => 'Signature data not found.', ], ], 'provisioning_api' => [ 'EXCEPTION' => [ 'class' => 'OC\\IntegrityCheck\\Exceptions\\InvalidSignatureException', 'message' => 'Signature data not found.', ], ], 'sketch' => [ 'EXCEPTION' => [ 'class' => 'OC\\IntegrityCheck\\Exceptions\\InvalidSignatureException', 'message' => 'Signature data not found.', ], ], 'threatblock' => [ 'EXCEPTION' => [ 'class' => 'OC\\IntegrityCheck\\Exceptions\\InvalidSignatureException', 'message' => 'Signature data not found.', ], ], 'two_factor_auth' => [ 'EXCEPTION' => [ 'class' => 'OC\\IntegrityCheck\\Exceptions\\InvalidSignatureException', 'message' => 'Signature data not found.', ], ], 'user_ldap' => [ 'EXCEPTION' => [ 'class' => 'OC\\IntegrityCheck\\Exceptions\\InvalidSignatureException', 'message' => 'Signature data not found.', ], ], 'user_shibboleth' => [ 'EXCEPTION' => [ 'class' => 'OC\\IntegrityCheck\\Exceptions\\InvalidSignatureException', 'message' => 'Signature data not found.', ], ], ]); + ->willReturn([ 'core' => [ 'EXTRA_FILE' => ['/testfile' => []], 'INVALID_HASH' => [ '/.idea/workspace.xml' => [ 'expected' => 'f1c5e2630d784bc9cb02d5a28f55d6f24d06dae2a0fee685f3c2521b050955d9d452769f61454c9ddfa9c308146ade10546cfa829794448eaffbc9a04a29d216', 'current' => 'ce08bf30bcbb879a18b49239a9bec6b8702f52452f88a9d32142cad8d2494d5735e6bfa0d8642b2762c62ca5be49f9bf4ec231d4a230559d4f3e2c471d3ea094', ], '/lib/private/integritycheck/checker.php' => [ 'expected' => 'c5a03bacae8dedf8b239997901ba1fffd2fe51271d13a00cc4b34b09cca5176397a89fc27381cbb1f72855fa18b69b6f87d7d5685c3b45aee373b09be54742ea', 'current' => '88a3a92c11db91dec1ac3be0e1c87f862c95ba6ffaaaa3f2c3b8f682187c66f07af3a3b557a868342ef4a271218fe1c1e300c478e6c156c5955ed53c40d06585', ], '/settings/controller/checksetupcontroller.php' => [ 'expected' => '3e1de26ce93c7bfe0ede7c19cb6c93cadc010340225b375607a7178812e9de163179b0dc33809f451e01f491d93f6f5aaca7929685d21594cccf8bda732327c4', 'current' => '09563164f9904a837f9ca0b5f626db56c838e5098e0ccc1d8b935f68fa03a25c5ec6f6b2d9e44a868e8b85764dafd1605522b4af8db0ae269d73432e9a01e63a', ], ], ], 'bookmarks' => [ 'EXCEPTION' => [ 'class' => 'OC\\IntegrityCheck\\Exceptions\\InvalidSignatureException', 'message' => 'Signature data not found.', ], ], 'dav' => [ 'EXCEPTION' => [ 'class' => 'OC\\IntegrityCheck\\Exceptions\\InvalidSignatureException', 'message' => 'Signature data not found.', ], ], 'encryption' => [ 'EXCEPTION' => [ 'class' => 'OC\\IntegrityCheck\\Exceptions\\InvalidSignatureException', 'message' => 'Signature data not found.', ], ], 'external' => [ 'EXCEPTION' => [ 'class' => 'OC\\IntegrityCheck\\Exceptions\\InvalidSignatureException', 'message' => 'Signature data not found.', ], ], 'federation' => [ 'EXCEPTION' => [ 'class' => 'OC\\IntegrityCheck\\Exceptions\\InvalidSignatureException', 'message' => 'Signature data not found.', ], ], 'files' => [ 'EXCEPTION' => [ 'class' => 'OC\\IntegrityCheck\\Exceptions\\InvalidSignatureException', 'message' => 'Signature data not found.', ], ], 'files_antivirus' => [ 'EXCEPTION' => [ 'class' => 'OC\\IntegrityCheck\\Exceptions\\InvalidSignatureException', 'message' => 'Signature data not found.', ], ], 'files_drop' => [ 'EXCEPTION' => [ 'class' => 'OC\\IntegrityCheck\\Exceptions\\InvalidSignatureException', 'message' => 'Signature data not found.', ], ], 'files_external' => [ 'EXCEPTION' => [ 'class' => 'OC\\IntegrityCheck\\Exceptions\\InvalidSignatureException', 'message' => 'Signature data not found.', ], ], 'files_pdfviewer' => [ 'EXCEPTION' => [ 'class' => 'OC\\IntegrityCheck\\Exceptions\\InvalidSignatureException', 'message' => 'Signature data not found.', ], ], 'files_sharing' => [ 'EXCEPTION' => [ 'class' => 'OC\\IntegrityCheck\\Exceptions\\InvalidSignatureException', 'message' => 'Signature data not found.', ], ], 'files_trashbin' => [ 'EXCEPTION' => [ 'class' => 'OC\\IntegrityCheck\\Exceptions\\InvalidSignatureException', 'message' => 'Signature data not found.', ], ], 'files_versions' => [ 'EXCEPTION' => [ 'class' => 'OC\\IntegrityCheck\\Exceptions\\InvalidSignatureException', 'message' => 'Signature data not found.', ], ], 'files_videoviewer' => [ 'EXCEPTION' => [ 'class' => 'OC\\IntegrityCheck\\Exceptions\\InvalidSignatureException', 'message' => 'Signature data not found.', ], ], 'firstrunwizard' => [ 'EXCEPTION' => [ 'class' => 'OC\\IntegrityCheck\\Exceptions\\InvalidSignatureException', 'message' => 'Signature data not found.', ], ], 'gitsmart' => [ 'EXCEPTION' => [ 'class' => 'OC\\IntegrityCheck\\Exceptions\\InvalidSignatureException', 'message' => 'Signature data not found.', ], ], 'logreader' => [ 'EXCEPTION' => [ 'class' => 'OC\\IntegrityCheck\\Exceptions\\InvalidSignatureException', 'message' => 'Signature could not get verified.', ], ], 'password_policy' => [ 'EXCEPTION' => [ 'class' => 'OC\\IntegrityCheck\\Exceptions\\InvalidSignatureException', 'message' => 'Signature data not found.', ], ], 'provisioning_api' => [ 'EXCEPTION' => [ 'class' => 'OC\\IntegrityCheck\\Exceptions\\InvalidSignatureException', 'message' => 'Signature data not found.', ], ], 'sketch' => [ 'EXCEPTION' => [ 'class' => 'OC\\IntegrityCheck\\Exceptions\\InvalidSignatureException', 'message' => 'Signature data not found.', ], ], 'threatblock' => [ 'EXCEPTION' => [ 'class' => 'OC\\IntegrityCheck\\Exceptions\\InvalidSignatureException', 'message' => 'Signature data not found.', ], ], 'two_factor_auth' => [ 'EXCEPTION' => [ 'class' => 'OC\\IntegrityCheck\\Exceptions\\InvalidSignatureException', 'message' => 'Signature data not found.', ], ], 'user_ldap' => [ 'EXCEPTION' => [ 'class' => 'OC\\IntegrityCheck\\Exceptions\\InvalidSignatureException', 'message' => 'Signature data not found.', ], ], 'user_shibboleth' => [ 'EXCEPTION' => [ 'class' => 'OC\\IntegrityCheck\\Exceptions\\InvalidSignatureException', 'message' => 'Signature data not found.', ], ], ]); $expected = new DataDisplayResponse( 'Technical information diff --git a/apps/sharebymail/tests/CapabilitiesTest.php b/apps/sharebymail/tests/CapabilitiesTest.php index 56e22f9469..5799e7e9cc 100644 --- a/apps/sharebymail/tests/CapabilitiesTest.php +++ b/apps/sharebymail/tests/CapabilitiesTest.php @@ -39,9 +39,9 @@ class CapabilitiesTest extends TestCase { public function testGetCapabilities() { $capabilities = [ - 'files_sharing' => + 'files_sharing' => [ - 'sharebymail' => + 'sharebymail' => [ 'enabled' => true, 'upload_files_drop' => ['enabled' => true], diff --git a/apps/systemtags/templates/list.php b/apps/systemtags/templates/list.php index 252199d2fc..80c20e24ed 100644 --- a/apps/systemtags/templates/list.php +++ b/apps/systemtags/templates/list.php @@ -18,14 +18,14 @@

t('Size')); ?> - t( 'Modified' )); ?> + t('Modified')); ?> diff --git a/apps/theming/lib/ThemingDefaults.php b/apps/theming/lib/ThemingDefaults.php index 76dd013702..413e2a9e64 100644 --- a/apps/theming/lib/ThemingDefaults.php +++ b/apps/theming/lib/ThemingDefaults.php @@ -198,7 +198,7 @@ class ThemingDefaults extends \OC_Defaults { $divider = ' · '; } } - if($legalLinks !== '' ) { + if($legalLinks !== '') { $footer .= '
' . $legalLinks; } @@ -353,7 +353,7 @@ class ThemingDefaults extends \OC_Defaults { } catch (AppPathNotFoundException $e) {} $route = $this->urlGenerator->linkToRoute('theming.Theming.getManifest'); } - if (strpos($image, 'filetypes/') === 0 && file_exists(\OC::$SERVERROOT . '/core/img/' . $image )) { + if (strpos($image, 'filetypes/') === 0 && file_exists(\OC::$SERVERROOT . '/core/img/' . $image)) { $route = $this->urlGenerator->linkToRoute('theming.Icon.getThemedIcon', ['app' => $app, 'image' => $image]); } diff --git a/apps/user_ldap/lib/Access.php b/apps/user_ldap/lib/Access.php index 81e467cb63..836e1fddb8 100644 --- a/apps/user_ldap/lib/Access.php +++ b/apps/user_ldap/lib/Access.php @@ -620,7 +620,7 @@ class Access extends LDAPUtility { // outside of core user management will still cache the user as non-existing. $originalTTL = $this->connection->ldapCacheTTL; $this->connection->setConfiguration(['ldapCacheTTL' => 0]); - if( $intName !== '' + if($intName !== '' && (($isUser && !$this->ncUserManager->userExists($intName)) || (!$isUser && !\OC::$server->getGroupManager()->groupExists($intName)) ) @@ -708,7 +708,7 @@ class Access extends LDAPUtility { foreach($ldapObjects as $ldapObject) { $nameByLDAP = null; - if( isset($ldapObject[$nameAttribute]) + if(isset($ldapObject[$nameAttribute]) && is_array($ldapObject[$nameAttribute]) && isset($ldapObject[$nameAttribute][0]) ) { @@ -1777,7 +1777,7 @@ class Access extends LDAPUtility { if($this->detectUuidAttribute($dn, $isUser, false, $ldapRecord)) { $attr = $this->connection->$uuidAttr; $uuid = isset($ldapRecord[$attr]) ? $ldapRecord[$attr] : $this->readAttribute($dn, $attr); - if( !is_array($uuid) + if(!is_array($uuid) && $uuidOverride !== '' && $this->detectUuidAttribute($dn, $isUser, true, $ldapRecord)) { diff --git a/apps/user_ldap/lib/Controller/RenewPasswordController.php b/apps/user_ldap/lib/Controller/RenewPasswordController.php index ff60cd3b2f..cc58f79cbd 100644 --- a/apps/user_ldap/lib/Controller/RenewPasswordController.php +++ b/apps/user_ldap/lib/Controller/RenewPasswordController.php @@ -54,7 +54,7 @@ class RenewPasswordController extends Controller { * @param IConfig $config * @param IURLGenerator $urlGenerator */ - function __construct($appName, IRequest $request, IUserManager $userManager, + function __construct($appName, IRequest $request, IUserManager $userManager, IConfig $config, IL10N $l10n, ISession $session, IURLGenerator $urlGenerator) { parent::__construct($appName, $request); $this->userManager = $userManager; diff --git a/apps/user_ldap/lib/Helper.php b/apps/user_ldap/lib/Helper.php index 93dc92f334..595e3c92ec 100644 --- a/apps/user_ldap/lib/Helper.php +++ b/apps/user_ldap/lib/Helper.php @@ -305,7 +305,7 @@ class Helper { $userBackend = new User_Proxy( $configPrefixes, $ldapWrapper, $ocConfig, $notificationManager, $userSession, $userPluginManager ); - $uid = $userBackend->loginName2UserName($param['uid'] ); + $uid = $userBackend->loginName2UserName($param['uid']); if($uid !== false) { $param['uid'] = $uid; } diff --git a/apps/user_ldap/lib/LDAPProvider.php b/apps/user_ldap/lib/LDAPProvider.php index 1916e10b8c..3119bcb013 100644 --- a/apps/user_ldap/lib/LDAPProvider.php +++ b/apps/user_ldap/lib/LDAPProvider.php @@ -110,7 +110,7 @@ class LDAPProvider implements ILDAPProvider, IDeletionFlagSupport { if(!$result){ throw new \Exception('Translation to LDAP DN unsuccessful'); } - return $result; + return $result; } /** diff --git a/apps/user_ldap/lib/LDAPProviderFactory.php b/apps/user_ldap/lib/LDAPProviderFactory.php index 637b2d4e67..ec8d0e3254 100644 --- a/apps/user_ldap/lib/LDAPProviderFactory.php +++ b/apps/user_ldap/lib/LDAPProviderFactory.php @@ -56,7 +56,7 @@ class LDAPProviderFactory implements ILDAPProviderFactory { $dbConnection = $this->serverContainer->getDatabaseConnection(); $userMapping = new UserMapping($dbConnection); return new LDAPProvider($this->serverContainer, new Helper($this->serverContainer->getConfig()), - new DeletedUsersIndex($this->serverContainer->getConfig(), + new DeletedUsersIndex($this->serverContainer->getConfig(), $dbConnection, $userMapping)); } } diff --git a/apps/user_ldap/lib/Migration/UUIDFixGroup.php b/apps/user_ldap/lib/Migration/UUIDFixGroup.php index 618e5c519e..a101a97a82 100644 --- a/apps/user_ldap/lib/Migration/UUIDFixGroup.php +++ b/apps/user_ldap/lib/Migration/UUIDFixGroup.php @@ -34,7 +34,7 @@ use OCP\IConfig; class UUIDFixGroup extends UUIDFix { public function __construct(GroupMapping $mapper, LDAP $ldap, IConfig $config, Helper $helper) { $this->mapper = $mapper; - $this->proxy = new User_Proxy($helper->getServerConfigurationPrefixes(true), $ldap, $config, + $this->proxy = new User_Proxy($helper->getServerConfigurationPrefixes(true), $ldap, $config, \OC::$server->getNotificationManager(), \OC::$server->getUserSession(), \OC::$server->query('LDAPUserPluginManager')); } diff --git a/apps/user_ldap/lib/User/Manager.php b/apps/user_ldap/lib/User/Manager.php index 3f3e8cd3be..c7660a40ba 100644 --- a/apps/user_ldap/lib/User/Manager.php +++ b/apps/user_ldap/lib/User/Manager.php @@ -130,7 +130,7 @@ class Manager { $this->checkAccess(); $user = new User($uid, $dn, $this->access, $this->ocConfig, $this->ocFilesystem, clone $this->image, $this->ocLog, - $this->avatarManager, $this->userManager, + $this->avatarManager, $this->userManager, $this->notificationManager); $this->usersByDN[$dn] = $user; $this->usersByUid[$uid] = $user; @@ -264,7 +264,7 @@ class Manager { return $this->usersByUid[$id]; } - if($this->access->stringResemblesDN($id) ) { + if($this->access->stringResemblesDN($id)) { $uid = $this->access->dn2username($id); if($uid !== false) { return $this->createAndCache($id, $uid); diff --git a/apps/user_ldap/lib/User/User.php b/apps/user_ldap/lib/User/User.php index ccd4062170..2c038e4328 100644 --- a/apps/user_ldap/lib/User/User.php +++ b/apps/user_ldap/lib/User/User.php @@ -327,12 +327,12 @@ class User { if ($path !== '') { //if attribute's value is an absolute path take this, otherwise append it to data dir //check for / at the beginning or pattern c:\ resp. c:/ - if( '/' !== $path[0] + if('/' !== $path[0] && !(3 < strlen($path) && ctype_alpha($path[0]) && $path[1] === ':' && ('\\' === $path[2] || '/' === $path[2])) ) { $path = $this->config->getSystemValue('datadirectory', - \OC::$SERVERROOT.'/data' ) . '/' . $path; + \OC::$SERVERROOT.'/data') . '/' . $path; } //we need it to store it in the DB as well in case a user gets //deleted so we can clean up afterwards @@ -342,7 +342,7 @@ class User { return $path; } - if( !is_null($attr) + if(!is_null($attr) && $this->config->getAppValue('user_ldap', 'enforce_home_folder_naming_rule', true) ) { // a naming rule attribute is defined, but it doesn't exist for that LDAP user diff --git a/apps/user_ldap/templates/settings.php b/apps/user_ldap/templates/settings.php index 0ac3a2bcc4..bbc809481a 100644 --- a/apps/user_ldap/templates/settings.php +++ b/apps/user_ldap/templates/settings.php @@ -83,7 +83,7 @@ style('user_ldap', 'settings');

-


+


t('Directory Settings'));?>

diff --git a/apps/user_ldap/tests/GroupLDAPPluginTest.php b/apps/user_ldap/tests/GroupLDAPPluginTest.php index 73c5271960..b5d9c40862 100644 --- a/apps/user_ldap/tests/GroupLDAPPluginTest.php +++ b/apps/user_ldap/tests/GroupLDAPPluginTest.php @@ -152,7 +152,7 @@ class GroupLDAPPluginTest extends \Test\TestCase { $pluginManager = $this->getGroupPluginManager(); $pluginManager->addToGroup('foo', 'bar'); - } + } public function testRemoveFromGroup() { $pluginManager = $this->getGroupPluginManager(); @@ -214,7 +214,7 @@ class GroupLDAPPluginTest extends \Test\TestCase { $pluginManager = $this->getGroupPluginManager(); $pluginManager->countUsersInGroup('foo', 'bar'); - } + } public function testgetGroupDetails() { $pluginManager = $this->getGroupPluginManager(); diff --git a/apps/user_ldap/tests/Group_LDAPTest.php b/apps/user_ldap/tests/Group_LDAPTest.php index a81255c10a..cf6e2d7bb8 100644 --- a/apps/user_ldap/tests/Group_LDAPTest.php +++ b/apps/user_ldap/tests/Group_LDAPTest.php @@ -194,7 +194,7 @@ class Group_LDAPTest extends TestCase { $ldap = new GroupLDAP($access, $pluginManager); $this->assertEquals($ldap->countUsersInGroup('gid', 'search'),42); - } + } public function testGidNumber2NameSuccess() { $access = $this->getAccessMock(); diff --git a/apps/user_ldap/tests/Jobs/CleanUpTest.php b/apps/user_ldap/tests/Jobs/CleanUpTest.php index 75bd6f0b08..bf4c8b75ba 100644 --- a/apps/user_ldap/tests/Jobs/CleanUpTest.php +++ b/apps/user_ldap/tests/Jobs/CleanUpTest.php @@ -55,7 +55,7 @@ class CleanUpTest extends \Test\TestCase { $args = $this->getMocks(); $args['helper']->expects($this->once()) ->method('haveDisabledConfigurations') - ->willReturn(true ); + ->willReturn(true); $args['ocConfig']->expects($this->never()) ->method('getSystemValue'); diff --git a/apps/user_ldap/tests/UserLDAPPluginTest.php b/apps/user_ldap/tests/UserLDAPPluginTest.php index 58bc63e442..03557ec174 100644 --- a/apps/user_ldap/tests/UserLDAPPluginTest.php +++ b/apps/user_ldap/tests/UserLDAPPluginTest.php @@ -153,7 +153,7 @@ class UserLDAPPluginTest extends \Test\TestCase { $pluginManager = $this->getUserPluginManager(); $pluginManager->getHome('foo'); - } + } public function testGetDisplayName() { $pluginManager = $this->getUserPluginManager(); @@ -204,7 +204,7 @@ class UserLDAPPluginTest extends \Test\TestCase { ); $pluginManager->register($plugin); - $pluginManager->setDisplayName('user', 'password'); + $pluginManager->setDisplayName('user', 'password'); } @@ -214,7 +214,7 @@ class UserLDAPPluginTest extends \Test\TestCase { $pluginManager = $this->getUserPluginManager(); $pluginManager->setDisplayName('foo', 'bar'); - } + } public function testCanChangeAvatar() { $pluginManager = $this->getUserPluginManager(); @@ -271,7 +271,7 @@ class UserLDAPPluginTest extends \Test\TestCase { $pluginManager = $this->getUserPluginManager(); $pluginManager->countUsers(); - } + } public function testDeleteUser() { $pluginManager = $this->getUserPluginManager(); diff --git a/build/integration/features/bootstrap/Sharing.php b/build/integration/features/bootstrap/Sharing.php index cc08470e98..590e0c4663 100644 --- a/build/integration/features/bootstrap/Sharing.php +++ b/build/integration/features/bootstrap/Sharing.php @@ -504,11 +504,11 @@ trait Sharing { $fd = $body->getRowsHash(); foreach($fd as $field => $value) { - if (substr($field, 0, 10 ) === "share_with"){ + if (substr($field, 0, 10) === "share_with"){ $value = str_replace("REMOTE", substr($this->remoteBaseUrl, 0, -5), $value); $value = str_replace("LOCAL", substr($this->localBaseUrl, 0, -5), $value); } - if (substr($field, 0, 6 ) === "remote"){ + if (substr($field, 0, 6) === "remote"){ $value = str_replace("REMOTE", substr($this->remoteBaseUrl, 0, -4), $value); $value = str_replace("LOCAL", substr($this->localBaseUrl, 0, -4), $value); } diff --git a/build/license.php b/build/license.php index 717ff13c75..ecb7bbd505 100644 --- a/build/license.php +++ b/build/license.php @@ -234,7 +234,7 @@ With help from many libraries and frameworks including: array_shift($lines); continue; } - if (strpos($line, '*/') !== false ) { + if (strpos($line, '*/') !== false) { array_shift($lines); break; } diff --git a/core/Command/Background/Base.php b/core/Command/Background/Base.php index 48d9edb8c8..a00a8fe4c5 100644 --- a/core/Command/Background/Base.php +++ b/core/Command/Background/Base.php @@ -71,7 +71,7 @@ abstract class Base extends Command { */ protected function execute(InputInterface $input, OutputInterface $output) { $mode = $this->getMode(); - $this->config->setAppValue( 'core', 'backgroundjobs_mode', $mode ); + $this->config->setAppValue('core', 'backgroundjobs_mode', $mode); $output->writeln("Set mode for background jobs to '$mode'"); } } diff --git a/core/Command/Encryption/DecryptAll.php b/core/Command/Encryption/DecryptAll.php index 4d7b402839..b4dc3e0160 100644 --- a/core/Command/Encryption/DecryptAll.php +++ b/core/Command/Encryption/DecryptAll.php @@ -125,7 +125,7 @@ class DecryptAll extends Command { } protected function execute(InputInterface $input, OutputInterface $output) { - if ( !$input->isInteractive() ) { + if (!$input->isInteractive()) { $output->writeln('Invalid TTY.'); $output->writeln('If you are trying to execute the command in a Docker '); $output->writeln("container, do not forget to execute 'docker exec' with"); diff --git a/core/Command/Encryption/EncryptAll.php b/core/Command/Encryption/EncryptAll.php index fecb7778ed..77c2cb3120 100644 --- a/core/Command/Encryption/EncryptAll.php +++ b/core/Command/Encryption/EncryptAll.php @@ -106,7 +106,7 @@ class EncryptAll extends Command { } protected function execute(InputInterface $input, OutputInterface $output) { - if ( !$input->isInteractive() ) { + if (!$input->isInteractive()) { $output->writeln('Invalid TTY.'); $output->writeln('If you are trying to execute the command in a Docker '); $output->writeln("container, do not forget to execute 'docker exec' with"); diff --git a/core/Controller/SetupController.php b/core/Controller/SetupController.php index 8205bb4920..f68ce9732f 100644 --- a/core/Controller/SetupController.php +++ b/core/Controller/SetupController.php @@ -109,7 +109,7 @@ class SetupController { } private function finishSetup(bool $installRecommended) { - if( file_exists( $this->autoConfigFile )) { + if(file_exists($this->autoConfigFile)) { unlink($this->autoConfigFile); } \OC::$server->getIntegrityCodeChecker()->runInstanceVerification(); @@ -130,7 +130,7 @@ class SetupController { } public function loadAutoConfig($post) { - if( file_exists($this->autoConfigFile)) { + if(file_exists($this->autoConfigFile)) { \OCP\Util::writeLog('core', 'Autoconfig file found, setting up Nextcloud…', ILogger::INFO); $AUTOCONFIG = []; include $this->autoConfigFile; diff --git a/core/templates/403.php b/core/templates/403.php index 72d5d3e4ae..d56a63bfe5 100644 --- a/core/templates/403.php +++ b/core/templates/403.php @@ -11,7 +11,7 @@ if(!isset($_)) {//standalone page is not supported anymore - redirect to / ?>
  • - t( 'Access forbidden' )); ?>
    + t('Access forbidden')); ?>

diff --git a/core/templates/installation.php b/core/templates/installation.php index 25052782e6..d5eec7f309 100644 --- a/core/templates/installation.php +++ b/core/templates/installation.php @@ -35,35 +35,35 @@ script('core', [
- t( 'Create an admin account' )); ?> + t('Create an admin account')); ?>

- +

- + - +

0): ?>
- t( 'Storage & database' )); ?> + t('Storage & database')); ?>
0): ?>
- + - t( 'Configure the database' )); ?> + t('Configure the database')); ?>
$label): ?>

- t( 'Only %s is available.', [$label] )); ?> - t( 'Install and activate additional PHP modules to choose other database types.' )); ?>
+ t('Only %s is available.', [$label])); ?> + t('Install and activate additional PHP modules to choose other database types.')); ?>
- t( 'For more details check out the documentation.' )); ?> ↗ + t('For more details check out the documentation.')); ?> ↗

@@ -100,25 +100,25 @@ script('core', [

- +

- +

- + @@ -126,23 +126,23 @@ script('core', [

- +

- +

- t( 'Please specify the port number along with the host name (e.g., localhost:5432).' )); ?> + t('Please specify the port number along with the host name (e.g., localhost:5432).')); ?>

@@ -162,15 +162,15 @@ script('core', [

 
-
+

diff --git a/core/templates/layout.guest.php b/core/templates/layout.guest.php index 8ba6b0a42b..6bb6e1c74b 100644 --- a/core/templates/layout.guest.php +++ b/core/templates/layout.guest.php @@ -30,7 +30,7 @@

- +
diff --git a/core/templates/update.use-cli.php b/core/templates/update.use-cli.php index 30f4169a1d..8cd7e37ffc 100644 --- a/core/templates/update.use-cli.php +++ b/core/templates/update.use-cli.php @@ -14,8 +14,8 @@
-

t('I know that if I continue doing the update via web UI has the risk, that the request runs into a timeout and could cause data loss, but I have a backup and know how to restore my instance in case of a failure.' )); ?>

- t('Upgrade via web on my own risk' )); ?> +

t('I know that if I continue doing the update via web UI has the risk, that the request runs into a timeout and could cause data loss, but I have a backup and know how to restore my instance in case of a failure.')); ?>

+ t('Upgrade via web on my own risk')); ?>
diff --git a/lib/base.php b/lib/base.php index f287815fa5..a86dccd082 100644 --- a/lib/base.php +++ b/lib/base.php @@ -265,7 +265,7 @@ class OC { $l->t('Cannot write into "config" directory!'), $l->t('This can usually be fixed by giving the webserver write access to the config directory.') . '. ' . $l->t('Or, if you prefer to keep config.php file read only, set the option "config_is_read_only" to true in it. See %s', - [ $urlGenerator->linkToDocs('admin-config') ] ), + [ $urlGenerator->linkToDocs('admin-config') ]), 503 ); } diff --git a/lib/private/AppFramework/Http.php b/lib/private/AppFramework/Http.php index 91d13b9e23..4b08812b6c 100644 --- a/lib/private/AppFramework/Http.php +++ b/lib/private/AppFramework/Http.php @@ -117,7 +117,7 @@ class Http extends BaseHttp { * @param string $ETag the etag * @return string */ - public function getStatusHeader($status, \DateTime $lastModified=null, + public function getStatusHeader($status, \DateTime $lastModified=null, $ETag=null) { if(!is_null($lastModified)) { @@ -131,7 +131,7 @@ class Http extends BaseHttp { || (isset($this->server['HTTP_IF_MODIFIED_SINCE']) - && trim($this->server['HTTP_IF_MODIFIED_SINCE']) === + && trim($this->server['HTTP_IF_MODIFIED_SINCE']) === $lastModified)) { $status = self::STATUS_NOT_MODIFIED; @@ -140,13 +140,13 @@ class Http extends BaseHttp { // we have one change currently for the http 1.0 header that differs // from 1.1: STATUS_TEMPORARY_REDIRECT should be STATUS_FOUND // if this differs any more, we want to create childclasses for this - if($status === self::STATUS_TEMPORARY_REDIRECT + if($status === self::STATUS_TEMPORARY_REDIRECT && $this->protocolVersion === 'HTTP/1.0') { $status = self::STATUS_FOUND; } - return $this->protocolVersion . ' ' . $status . ' ' . + return $this->protocolVersion . ' ' . $status . ' ' . $this->headers[$status]; } diff --git a/lib/private/Avatar/Avatar.php b/lib/private/Avatar/Avatar.php index a097db286f..4badc8c43f 100644 --- a/lib/private/Avatar/Avatar.php +++ b/lib/private/Avatar/Avatar.php @@ -300,7 +300,7 @@ abstract class Avatar implements IAvatar { $hash = strtolower($hash); // Already a md5 hash? - if( preg_match('/^([0-9a-f]{4}-?){8}$/', $hash, $matches) !== 1 ) { + if(preg_match('/^([0-9a-f]{4}-?){8}$/', $hash, $matches) !== 1) { $hash = md5($hash); } diff --git a/lib/private/Collaboration/Collaborators/RemotePlugin.php b/lib/private/Collaboration/Collaborators/RemotePlugin.php index b41e6441f8..6309b8e6ea 100644 --- a/lib/private/Collaboration/Collaborators/RemotePlugin.php +++ b/lib/private/Collaboration/Collaborators/RemotePlugin.php @@ -96,7 +96,7 @@ class RemotePlugin implements ISearchPlugin { /** * Add local share if remote cloud id matches a local user ones */ - if ($localUser !== null && $remoteUser !== $this->userId && $cloudId === $localUser->getCloudId() ) { + if ($localUser !== null && $remoteUser !== $this->userId && $cloudId === $localUser->getCloudId()) { $result['wide'][] = [ 'label' => $contact['FN'], 'uuid' => $contact['UID'], diff --git a/lib/private/DB/AdapterPgSql.php b/lib/private/DB/AdapterPgSql.php index 0febdd7f1f..dd9c7dc968 100644 --- a/lib/private/DB/AdapterPgSql.php +++ b/lib/private/DB/AdapterPgSql.php @@ -35,8 +35,8 @@ class AdapterPgSql extends Adapter { const UNIX_TIMESTAMP_REPLACEMENT = 'cast(extract(epoch from current_timestamp) as integer)'; public function fixupStatement($statement) { - $statement = str_replace( '`', '"', $statement ); - $statement = str_ireplace( 'UNIX_TIMESTAMP()', self::UNIX_TIMESTAMP_REPLACEMENT, $statement ); + $statement = str_replace('`', '"', $statement); + $statement = str_ireplace('UNIX_TIMESTAMP()', self::UNIX_TIMESTAMP_REPLACEMENT, $statement); return $statement; } diff --git a/lib/private/DB/AdapterSqlite.php b/lib/private/DB/AdapterSqlite.php index 20d2773213..2d8715e90f 100644 --- a/lib/private/DB/AdapterSqlite.php +++ b/lib/private/DB/AdapterSqlite.php @@ -43,10 +43,10 @@ class AdapterSqlite extends Adapter { public function fixupStatement($statement) { $statement = preg_replace('/`(\w+)` ILIKE \?/', 'LOWER($1) LIKE LOWER(?)', $statement); - $statement = str_replace( '`', '"', $statement ); - $statement = str_ireplace( 'NOW()', 'datetime(\'now\')', $statement ); + $statement = str_replace('`', '"', $statement); + $statement = str_ireplace('NOW()', 'datetime(\'now\')', $statement); $statement = str_ireplace('GREATEST(', 'MAX(', $statement); - $statement = str_ireplace( 'UNIX_TIMESTAMP()', 'strftime(\'%s\',\'now\')', $statement ); + $statement = str_ireplace('UNIX_TIMESTAMP()', 'strftime(\'%s\',\'now\')', $statement); return $statement; } diff --git a/lib/private/DB/Connection.php b/lib/private/DB/Connection.php index bfca8d4ec7..a0c0ac1848 100644 --- a/lib/private/DB/Connection.php +++ b/lib/private/DB/Connection.php @@ -395,7 +395,7 @@ class Connection extends ReconnectWrapper implements IDBConnection { * @return string */ protected function replaceTablePrefix($statement) { - return str_replace( '*PREFIX*', $this->tablePrefix, $statement ); + return str_replace('*PREFIX*', $this->tablePrefix, $statement); } /** diff --git a/lib/private/Encryption/Util.php b/lib/private/Encryption/Util.php index 9010f81dc4..937a77bca7 100644 --- a/lib/private/Encryption/Util.php +++ b/lib/private/Encryption/Util.php @@ -253,7 +253,7 @@ class Util { public function stripPartialFileExtension($path) { $extension = pathinfo($path, PATHINFO_EXTENSION); - if ( $extension === 'part') { + if ($extension === 'part') { $newLength = strlen($path) - 5; // 5 = strlen(".part") $fPath = substr($path, 0, $newLength); diff --git a/lib/private/Files/ObjectStore/HomeObjectStoreStorage.php b/lib/private/Files/ObjectStore/HomeObjectStoreStorage.php index 0632caedc6..98b99efcb5 100644 --- a/lib/private/Files/ObjectStore/HomeObjectStoreStorage.php +++ b/lib/private/Files/ObjectStore/HomeObjectStoreStorage.php @@ -34,7 +34,7 @@ class HomeObjectStoreStorage extends ObjectStoreStorage implements \OCP\Files\IH * @param array $params */ public function __construct($params) { - if ( ! isset($params['user']) || ! $params['user'] instanceof User) { + if (! isset($params['user']) || ! $params['user'] instanceof User) { throw new \Exception('missing user object in parameters'); } $this->user = $params['user']; diff --git a/lib/private/Group/Database.php b/lib/private/Group/Database.php index ba023d64ac..99654b5d1f 100644 --- a/lib/private/Group/Database.php +++ b/lib/private/Group/Database.php @@ -194,7 +194,7 @@ class Database extends ABackend $this->fixDI(); // No duplicate entries! - if( !$this->inGroup( $uid, $gid )) { + if(!$this->inGroup($uid, $gid)) { $qb = $this->dbConn->getQueryBuilder(); $qb->insert('group_user') ->setValue('uid', $qb->createNamedParameter($uid)) @@ -250,7 +250,7 @@ class Database extends ABackend ->execute(); $groups = []; - while( $row = $cursor->fetch()) { + while($row = $cursor->fetch()) { $groups[] = $row['gid']; $this->groupCache[$row['gid']] = $row['gid']; } diff --git a/lib/private/Installer.php b/lib/private/Installer.php index b3919f22d0..78925a56a2 100644 --- a/lib/private/Installer.php +++ b/lib/private/Installer.php @@ -479,7 +479,7 @@ class Installer { * this has to be done by the function oc_app_uninstall(). */ public function removeApp($appId) { - if($this->isDownloaded( $appId )) { + if($this->isDownloaded($appId)) { if (\OC::$server->getAppManager()->isShipped($appId)) { return false; } @@ -528,10 +528,10 @@ class Installer { $config = \OC::$server->getConfig(); $errors = []; foreach(\OC::$APPSROOTS as $app_dir) { - if($dir = opendir( $app_dir['path'] )) { - while( false !== ( $filename = readdir( $dir ))) { - if( $filename[0] !== '.' and is_dir($app_dir['path']."/$filename") ) { - if( file_exists( $app_dir['path']."/$filename/appinfo/info.xml" )) { + if($dir = opendir($app_dir['path'])) { + while(false !== ($filename = readdir($dir))) { + if($filename[0] !== '.' and is_dir($app_dir['path']."/$filename")) { + if(file_exists($app_dir['path']."/$filename/appinfo/info.xml")) { if($config->getAppValue($filename, "installed_version", null) === null) { $info=OC_App::getAppInfo($filename); $enabled = isset($info['default_enable']); @@ -556,7 +556,7 @@ class Installer { } } } - closedir( $dir ); + closedir($dir); } } @@ -623,7 +623,7 @@ class Installer { * @param string $script */ private static function includeAppScript($script) { - if ( file_exists($script) ){ + if (file_exists($script)){ include $script; } } diff --git a/lib/private/L10N/Factory.php b/lib/private/L10N/Factory.php index 2902136e62..5624155dad 100644 --- a/lib/private/L10N/Factory.php +++ b/lib/private/L10N/Factory.php @@ -526,10 +526,10 @@ class Factory implements IFactory { return $this->pluralFunctions[$string]; } - if (preg_match( '/^\s*nplurals\s*=\s*(\d+)\s*;\s*plural=(.*)$/u', $string, $matches)) { + if (preg_match('/^\s*nplurals\s*=\s*(\d+)\s*;\s*plural=(.*)$/u', $string, $matches)) { // sanitize - $nplurals = preg_replace( '/[^0-9]/', '', $matches[1] ); - $plural = preg_replace( '#[^n0-9:\(\)\?\|\&=!<>+*/\%-]#', '', $matches[2] ); + $nplurals = preg_replace('/[^0-9]/', '', $matches[1]); + $plural = preg_replace('#[^n0-9:\(\)\?\|\&=!<>+*/\%-]#', '', $matches[2]); $body = str_replace( [ 'plural', 'n', '$n$plurals', ], @@ -545,7 +545,7 @@ class Factory implements IFactory { $length = strlen($body); for($i = 0; $i < $length; $i++) { $ch = $body[$i]; - switch ( $ch ) { + switch ($ch) { case '?': $res .= ' ? ('; $p++; @@ -554,7 +554,7 @@ class Factory implements IFactory { $res .= ') : ('; break; case ';': - $res .= str_repeat( ')', $p ) . ';'; + $res .= str_repeat(')', $p) . ';'; $p = 0; break; default: @@ -627,7 +627,7 @@ class Factory implements IFactory { ksort($commonLanguages); // sort now by displayed language not the iso-code - usort( $languages, function ($a, $b) { + usort($languages, function ($a, $b) { if ($a['code'] === $a['name'] && $b['code'] !== $b['name']) { // If a doesn't have a name, but b does, list b before a return 1; diff --git a/lib/private/Search.php b/lib/private/Search.php index 598eda82a5..42a925f90d 100644 --- a/lib/private/Search.php +++ b/lib/private/Search.php @@ -53,7 +53,7 @@ class Search implements ISearch { $results = []; foreach($this->providers as $provider) { /** @var $provider Provider */ - if ( ! $provider->providesResultsFor($inApps) ) { + if (! $provider->providesResultsFor($inApps)) { continue; } if ($provider instanceof PagedProvider) { @@ -109,7 +109,7 @@ class Search implements ISearch { * Create instances of all the registered search providers */ private function initProviders() { - if( ! empty($this->providers) ) { + if(! empty($this->providers)) { return; } foreach($this->registeredProviders as $provider) { diff --git a/lib/private/Share/Share.php b/lib/private/Share/Share.php index 5fcb38de00..9b74239d69 100644 --- a/lib/private/Share/Share.php +++ b/lib/private/Share/Share.php @@ -854,7 +854,7 @@ class Share extends Constants { } // Add display names to result $row['share_with_displayname'] = $row['share_with']; - if ( isset($row['share_with']) && $row['share_with'] != '' && + if (isset($row['share_with']) && $row['share_with'] != '' && $row['share_type'] === self::SHARE_TYPE_USER) { $shareWithUser = \OC::$server->getUserManager()->get($row['share_with']); $row['share_with_displayname'] = $shareWithUser === null ? $row['share_with'] : $shareWithUser->getDisplayName(); @@ -869,7 +869,7 @@ class Share extends Constants { } } } - if ( isset($row['uid_owner']) && $row['uid_owner'] != '') { + if (isset($row['uid_owner']) && $row['uid_owner'] != '') { $ownerUser = \OC::$server->getUserManager()->get($row['uid_owner']); $row['displayname_owner'] = $ownerUser === null ? $row['uid_owner'] : $ownerUser->getDisplayName(); } @@ -1018,7 +1018,7 @@ class Share extends Constants { // for file/folder shares we need to compare file_source, otherwise we compare item_source // only group shares if they already point to the same target, otherwise the file where shared // before grouping of shares was added. In this case we don't group them toi avoid confusions - if (( $fileSharing && $item['file_source'] === $r['file_source'] && $item['file_target'] === $r['file_target']) || + if (($fileSharing && $item['file_source'] === $r['file_source'] && $item['file_target'] === $r['file_target']) || (!$fileSharing && $item['item_source'] === $r['item_source'] && $item['item_target'] === $r['item_target'])) { // add the first item to the list of grouped shares if (!isset($result[$key]['grouped'])) { diff --git a/lib/private/Tags.php b/lib/private/Tags.php index 20a80672a5..4d05beb259 100644 --- a/lib/private/Tags.php +++ b/lib/private/Tags.php @@ -306,7 +306,7 @@ class Tags implements ITags { } if(!is_null($result)) { - while( $row = $result->fetchRow()) { + while($row = $result->fetchRow()) { $id = (int)$row['objid']; if ($this->includeShared) { @@ -452,7 +452,7 @@ class Tags implements ITags { if(!$this->hasTag($name) && $name !== '') { $newones[] = new Tag($this->user, $this->type, $name); } - if(!is_null($id) ) { + if(!is_null($id)) { // Insert $objectid, $categoryid pairs if not exist. self::$relations[] = ['objid' => $id, 'tag' => $name]; } @@ -550,7 +550,7 @@ class Tags implements ITags { try { $stmt = \OC_DB::prepare('DELETE FROM `' . self::RELATION_TABLE . '` ' . 'WHERE `categoryid` = ?'); - while( $row = $result->fetchRow()) { + while($row = $result->fetchRow()) { try { $stmt->execute([$row['id']]); } catch(\Exception $e) { diff --git a/lib/private/Template/Base.php b/lib/private/Template/Base.php index ddbe58b6d9..d07cf2249f 100644 --- a/lib/private/Template/Base.php +++ b/lib/private/Template/Base.php @@ -65,7 +65,7 @@ class Base { */ protected function getAppTemplateDirs($theme, $app, $serverRoot, $app_dir) { // Check if the app is in the app folder or in the root - if( file_exists($app_dir.'/templates/' )) { + if(file_exists($app_dir.'/templates/')) { return [ $serverRoot.'/themes/'.$theme.'/apps/'.$app.'/templates/', $app_dir.'/templates/', @@ -115,7 +115,7 @@ class Base { * $_[$key][$position] in the template. */ public function append($key, $value) { - if( array_key_exists( $key, $this->vars )) { + if(array_key_exists($key, $this->vars)) { $this->vars[$key][] = $value; } else{ @@ -131,7 +131,7 @@ class Base { */ public function printPage() { $data = $this->fetchPage(); - if( $data === false ) { + if($data === false) { return false; } else{ @@ -168,7 +168,7 @@ class Base { $theme = $this->theme; if(!is_null($additionalParams)) { - $_ = array_merge( $additionalParams, $this->vars ); + $_ = array_merge($additionalParams, $this->vars); foreach ($_ as $var => $value) { ${$var} = $value; } diff --git a/lib/private/TemplateLayout.php b/lib/private/TemplateLayout.php index 3ed0b86a26..968ae7fceb 100644 --- a/lib/private/TemplateLayout.php +++ b/lib/private/TemplateLayout.php @@ -75,7 +75,7 @@ class TemplateLayout extends \OC_Template { // Decide which page we show if($renderAs === 'user') { - parent::__construct( 'core', 'layout.user' ); + parent::__construct('core', 'layout.user'); if(in_array(\OC_App::getCurrentApp(), ['settings','admin', 'help']) !== false) { $this->assign('bodyid', 'body-settings'); }else{ @@ -83,22 +83,22 @@ class TemplateLayout extends \OC_Template { } // Add navigation entry - $this->assign( 'application', ''); - $this->assign( 'appid', $appId ); + $this->assign('application', ''); + $this->assign('appid', $appId); $navigation = \OC::$server->getNavigationManager()->getAll(); - $this->assign( 'navigation', $navigation); + $this->assign('navigation', $navigation); $settingsNavigation = \OC::$server->getNavigationManager()->getAll('settings'); - $this->assign( 'settingsnavigation', $settingsNavigation); + $this->assign('settingsnavigation', $settingsNavigation); foreach($navigation as $entry) { if ($entry['active']) { - $this->assign( 'application', $entry['name'] ); + $this->assign('application', $entry['name']); break; } } foreach($settingsNavigation as $entry) { if ($entry['active']) { - $this->assign( 'application', $entry['name'] ); + $this->assign('application', $entry['name']); break; } } @@ -139,7 +139,7 @@ class TemplateLayout extends \OC_Template { $this->assign('user_uid', \OC_User::getUser()); } else if ($renderAs === 'public') { parent::__construct('core', 'layout.public'); - $this->assign( 'appid', $appId ); + $this->assign('appid', $appId); $this->assign('bodyid', 'body-public'); /** @var IRegistry $subscription */ @@ -196,7 +196,7 @@ class TemplateLayout extends \OC_Template { foreach($jsFiles as $info) { $web = $info[1]; $file = $info[2]; - $this->append( 'jsfiles', $web.'/'.$file . $this->getVersionHashSuffix() ); + $this->append('jsfiles', $web.'/'.$file . $this->getVersionHashSuffix()); } try { @@ -229,14 +229,14 @@ class TemplateLayout extends \OC_Template { $file = $info[2]; if (substr($file, -strlen('print.css')) === 'print.css') { - $this->append( 'printcssfiles', $web.'/'.$file . $this->getVersionHashSuffix() ); + $this->append('printcssfiles', $web.'/'.$file . $this->getVersionHashSuffix()); } else { $suffix = $this->getVersionHashSuffix($web, $file); if (strpos($file, '?v=') == false) { - $this->append( 'cssfiles', $web.'/'.$file . $suffix); + $this->append('cssfiles', $web.'/'.$file . $suffix); } else { - $this->append( 'cssfiles', $web.'/'.$file . '-' . substr($suffix, 3)); + $this->append('cssfiles', $web.'/'.$file . '-' . substr($suffix, 3)); } } diff --git a/lib/private/URLGenerator.php b/lib/private/URLGenerator.php index 62eafaafed..c0896ec351 100644 --- a/lib/private/URLGenerator.php +++ b/lib/private/URLGenerator.php @@ -122,7 +122,7 @@ class URLGenerator implements IURLGenerator { public function linkTo(string $app, string $file, array $args = []): string { $frontControllerActive = ($this->config->getSystemValue('htaccess.IgnoreFrontController', false) === true || getenv('front_controller_active') === 'true'); - if( $app !== '' ) { + if($app !== '') { $app_path = \OC_App::getAppPath($app); // Check if the app is in the app folder if ($app_path && file_exists($app_path . '/' . $file)) { diff --git a/lib/private/User/Backend.php b/lib/private/User/Backend.php index 24f7c5161b..4a3c5bdca1 100644 --- a/lib/private/User/Backend.php +++ b/lib/private/User/Backend.php @@ -150,7 +150,7 @@ abstract class Backend implements UserInterface { public function getDisplayNames($search = '', $limit = null, $offset = null) { $displayNames = []; $users = $this->getUsers($search, $limit, $offset); - foreach ( $users as $user) { + foreach ($users as $user) { $displayNames[$user] = $user; } return $displayNames; diff --git a/lib/private/User/Session.php b/lib/private/User/Session.php index ca0c7263f7..7b129a393e 100644 --- a/lib/private/User/Session.php +++ b/lib/private/User/Session.php @@ -459,7 +459,7 @@ class Session implements IUserSession, Emitter { } // Try to login with this username and password - if (!$this->login($user, $password) ) { + if (!$this->login($user, $password)) { // Failed, maybe the user used their email address $users = $this->manager->getByEmail($user); diff --git a/lib/private/User/User.php b/lib/private/User/User.php index 0f17af3063..bc492a6df2 100644 --- a/lib/private/User/User.php +++ b/lib/private/User/User.php @@ -449,7 +449,7 @@ class User implements IUser { public function getCloudId() { $uid = $this->getUID(); $server = $this->urlGenerator->getAbsoluteURL('/'); - $server = rtrim( $this->removeProtocolFromUrl($server), '/'); + $server = rtrim($this->removeProtocolFromUrl($server), '/'); return \OC::$server->getCloudIdManager()->getCloudId($uid, $server)->getId(); } diff --git a/lib/private/legacy/OC_DB.php b/lib/private/legacy/OC_DB.php index edcac8f907..cf45faae31 100644 --- a/lib/private/legacy/OC_DB.php +++ b/lib/private/legacy/OC_DB.php @@ -126,14 +126,14 @@ class OC_DB { } if (is_array($stmt)) { // convert to prepared statement - if ( ! array_key_exists('sql', $stmt) ) { + if (! array_key_exists('sql', $stmt)) { $message = 'statement array must at least contain key \'sql\''; throw new \OC\DatabaseException($message); } - if ( ! array_key_exists('limit', $stmt) ) { + if (! array_key_exists('limit', $stmt)) { $stmt['limit'] = null; } - if ( ! array_key_exists('limit', $stmt) ) { + if (! array_key_exists('limit', $stmt)) { $stmt['offset'] = null; } $stmt = self::prepare($stmt['sql'], $stmt['limit'], $stmt['offset']); diff --git a/lib/private/legacy/OC_Hook.php b/lib/private/legacy/OC_Hook.php index d7b1e414a0..b98424711d 100644 --- a/lib/private/legacy/OC_Hook.php +++ b/lib/private/legacy/OC_Hook.php @@ -54,12 +54,12 @@ class OC_Hook { static public function connect($signalClass, $signalName, $slotClass, $slotName) { // If we're trying to connect to an emitting class that isn't // yet registered, register it - if( !array_key_exists($signalClass, self::$registered )) { + if(!array_key_exists($signalClass, self::$registered)) { self::$registered[$signalClass] = []; } // If we're trying to connect to an emitting method that isn't // yet registered, register it with the emitting class - if( !array_key_exists( $signalName, self::$registered[$signalClass] )) { + if(!array_key_exists($signalName, self::$registered[$signalClass])) { self::$registered[$signalClass][$signalName] = []; } @@ -95,20 +95,20 @@ class OC_Hook { // Return false if no hook handlers are listening to this // emitting class - if( !array_key_exists($signalClass, self::$registered )) { + if(!array_key_exists($signalClass, self::$registered)) { return false; } // Return false if no hook handlers are listening to this // emitting method - if( !array_key_exists( $signalName, self::$registered[$signalClass] )) { + if(!array_key_exists($signalName, self::$registered[$signalClass])) { return false; } // Call all slots - foreach( self::$registered[$signalClass][$signalName] as $i ) { + foreach(self::$registered[$signalClass][$signalName] as $i) { try { - call_user_func( [ $i["class"], $i["name"] ], $params ); + call_user_func([ $i["class"], $i["name"] ], $params); } catch (Exception $e){ self::$thrownExceptions[] = $e; \OC::$server->getLogger()->logException($e); diff --git a/lib/private/legacy/OC_JSON.php b/lib/private/legacy/OC_JSON.php index f83fca0a43..5b4b97e6fd 100644 --- a/lib/private/legacy/OC_JSON.php +++ b/lib/private/legacy/OC_JSON.php @@ -42,7 +42,7 @@ class OC_JSON{ * @suppress PhanDeprecatedFunction */ public static function checkAppEnabled($app) { - if( !\OC::$server->getAppManager()->isEnabledForUser($app)) { + if(!\OC::$server->getAppManager()->isEnabledForUser($app)) { $l = \OC::$server->getL10N('lib'); self::error([ 'data' => [ 'message' => $l->t('Application is not enabled'), 'error' => 'application_not_enabled' ]]); exit(); @@ -56,7 +56,7 @@ class OC_JSON{ */ public static function checkLoggedIn() { $twoFactorAuthManger = \OC::$server->getTwoFactorAuthManager(); - if( !\OC::$server->getUserSession()->isLoggedIn() + if(!\OC::$server->getUserSession()->isLoggedIn() || $twoFactorAuthManger->needsSecondFactor(\OC::$server->getUserSession()->getUser())) { $l = \OC::$server->getL10N('lib'); http_response_code(\OCP\AppFramework\Http::STATUS_UNAUTHORIZED); @@ -76,7 +76,7 @@ class OC_JSON{ exit(); } - if( !\OC::$server->getRequest()->passesCSRFCheck()) { + if(!\OC::$server->getRequest()->passesCSRFCheck()) { $l = \OC::$server->getL10N('lib'); self::error([ 'data' => [ 'message' => $l->t('Token expired. Please reload page.'), 'error' => 'token_expired' ]]); exit(); @@ -89,7 +89,7 @@ class OC_JSON{ * @suppress PhanDeprecatedFunction */ public static function checkAdminUser() { - if( !OC_User::isAdminUser(OC_User::getUser())) { + if(!OC_User::isAdminUser(OC_User::getUser())) { $l = \OC::$server->getL10N('lib'); self::error([ 'data' => [ 'message' => $l->t('Authentication error'), 'error' => 'authentication_error' ]]); exit(); @@ -103,7 +103,7 @@ class OC_JSON{ */ public static function error($data = []) { $data['status'] = 'error'; - header( 'Content-Type: application/json; charset=utf-8'); + header('Content-Type: application/json; charset=utf-8'); echo self::encode($data); } @@ -114,7 +114,7 @@ class OC_JSON{ */ public static function success($data = []) { $data['status'] = 'success'; - header( 'Content-Type: application/json; charset=utf-8'); + header('Content-Type: application/json; charset=utf-8'); echo self::encode($data); } diff --git a/lib/private/legacy/OC_Response.php b/lib/private/legacy/OC_Response.php index d30f56ca1b..45fea27d61 100644 --- a/lib/private/legacy/OC_Response.php +++ b/lib/private/legacy/OC_Response.php @@ -40,10 +40,10 @@ class OC_Response { \OC\AppFramework\Http\Request::USER_AGENT_ANDROID_MOBILE_CHROME, \OC\AppFramework\Http\Request::USER_AGENT_FREEBOX, ])) { - header( 'Content-Disposition: ' . rawurlencode($type) . '; filename="' . rawurlencode( $filename ) . '"' ); + header('Content-Disposition: ' . rawurlencode($type) . '; filename="' . rawurlencode($filename) . '"'); } else { - header( 'Content-Disposition: ' . rawurlencode($type) . '; filename*=UTF-8\'\'' . rawurlencode( $filename ) - . '; filename="' . rawurlencode( $filename ) . '"' ); + header('Content-Disposition: ' . rawurlencode($type) . '; filename*=UTF-8\'\'' . rawurlencode($filename) + . '; filename="' . rawurlencode($filename) . '"'); } } diff --git a/lib/private/legacy/OC_Template.php b/lib/private/legacy/OC_Template.php index ad1d31d80f..08f23b55a0 100644 --- a/lib/private/legacy/OC_Template.php +++ b/lib/private/legacy/OC_Template.php @@ -105,8 +105,8 @@ class OC_Template extends \OC\Template\Base { //so to make sure this scripts/styles here are loaded first we use OC_Util::addScript() with $prepend=true //meaning the last script/style in this list will be loaded first if (\OC::$server->getSystemConfig()->getValue('installed', false) && $renderAs !== 'error' && !\OCP\Util::needUpgrade()) { - if (\OC::$server->getConfig()->getAppValue( 'core', 'backgroundjobs_mode', 'ajax' ) == 'ajax') { - OC_Util::addScript( 'backgroundjobs', null, true ); + if (\OC::$server->getConfig()->getAppValue('core', 'backgroundjobs_mode', 'ajax') == 'ajax') { + OC_Util::addScript('backgroundjobs', null, true); } } OC_Util::addStyle('css-variables', null, true); @@ -146,12 +146,12 @@ class OC_Template extends \OC\Template\Base { */ protected function findTemplate($theme, $app, $name) { // Check if it is a app template or not. - if( $app !== '' ) { + if($app !== '') { $dirs = $this->getAppTemplateDirs($theme, $app, OC::$SERVERROOT, OC_App::getAppPath($app)); } else { $dirs = $this->getCoreTemplateDirs($theme, OC::$SERVERROOT); } - $locator = new \OC\Template\TemplateFileLocator( $dirs ); + $locator = new \OC\Template\TemplateFileLocator($dirs); $template = $locator->find($name); $path = $locator->getPath(); return [$path, $template]; @@ -182,7 +182,7 @@ class OC_Template extends \OC\Template\Base { public function fetchPage($additionalParams = null) { $data = parent::fetchPage($additionalParams); - if( $this->renderAs ) { + if($this->renderAs) { $page = new TemplateLayout($this->renderAs, $this->app); if(is_array($additionalParams)) { @@ -195,7 +195,7 @@ class OC_Template extends \OC\Template\Base { $headers = ''; foreach(OC_Util::$headers as $header) { $headers .= '<'.\OCP\Util::sanitizeHTML($header['tag']); - if ( strcasecmp($header['tag'], 'script') === 0 && in_array('src', array_map('strtolower', array_keys($header['attributes']))) ) { + if (strcasecmp($header['tag'], 'script') === 0 && in_array('src', array_map('strtolower', array_keys($header['attributes'])))) { $headers .= ' defer'; } foreach($header['attributes'] as $name=>$value) { @@ -239,9 +239,9 @@ class OC_Template extends \OC\Template\Base { * @return boolean|null */ public static function printUserPage($application, $name, $parameters = []) { - $content = new OC_Template( $application, $name, "user" ); - foreach( $parameters as $key => $value ) { - $content->assign( $key, $value ); + $content = new OC_Template($application, $name, "user"); + foreach($parameters as $key => $value) { + $content->assign($key, $value); } print $content->printPage(); } @@ -254,9 +254,9 @@ class OC_Template extends \OC\Template\Base { * @return bool */ public static function printAdminPage($application, $name, $parameters = []) { - $content = new OC_Template( $application, $name, "admin" ); - foreach( $parameters as $key => $value ) { - $content->assign( $key, $value ); + $content = new OC_Template($application, $name, "admin"); + foreach($parameters as $key => $value) { + $content->assign($key, $value); } return $content->printPage(); } @@ -270,8 +270,8 @@ class OC_Template extends \OC\Template\Base { */ public static function printGuestPage($application, $name, $parameters = []) { $content = new OC_Template($application, $name, $name === 'error' ? $name : 'guest'); - foreach( $parameters as $key => $value ) { - $content->assign( $key, $value ); + foreach($parameters as $key => $value) { + $content->assign($key, $value); } return $content->printPage(); } @@ -296,9 +296,9 @@ class OC_Template extends \OC\Template\Base { http_response_code($statusCode); try { - $content = new \OC_Template( '', 'error', 'error', false ); + $content = new \OC_Template('', 'error', 'error', false); $errors = [['error' => $error_msg, 'hint' => $hint]]; - $content->assign( 'errors', $errors ); + $content->assign('errors', $errors); $content->printPage(); } catch (\Exception $e) { $logger = \OC::$server->getLogger(); diff --git a/lib/private/legacy/OC_Util.php b/lib/private/legacy/OC_Util.php index 378c393831..4d7d00f5dc 100644 --- a/lib/private/legacy/OC_Util.php +++ b/lib/private/legacy/OC_Util.php @@ -590,7 +590,7 @@ class OC_Util { // core js files need separate handling if ($application !== 'core' && $file !== null) { - self::addTranslations( $application ); + self::addTranslations($application); } self::addExternalResource($application, $prepend, $path, "script"); } @@ -667,7 +667,7 @@ class OC_Util { if ($type === "style") { if (!in_array($path, self::$styles)) { if ($prepend === true) { - array_unshift( self::$styles, $path ); + array_unshift(self::$styles, $path); } else { self::$styles[] = $path; } @@ -675,7 +675,7 @@ class OC_Util { } elseif ($type === "script") { if (!in_array($path, self::$scripts)) { if ($prepend === true) { - array_unshift( self::$scripts, $path ); + array_unshift(self::$scripts, $path); } else { self::$scripts [] = $path; } @@ -757,7 +757,7 @@ class OC_Util { 'hint' => $l->t('This can usually be fixed by giving the webserver write access to the config directory. See %s', [ $urlGenerator->linkToDocs('admin-dir_permissions') ]) . '. ' . $l->t('Or, if you prefer to keep config.php file read only, set the option "config_is_read_only" to true in it. See %s', - [ $urlGenerator->linkToDocs('admin-config') ] ) + [ $urlGenerator->linkToDocs('admin-config') ]) ]; } } @@ -925,7 +925,7 @@ class OC_Util { } if(function_exists('xml_parser_create') && - LIBXML_LOADED_VERSION < 20700 ) { + LIBXML_LOADED_VERSION < 20700) { $version = LIBXML_LOADED_VERSION; $major = floor($version/10000); $version -= ($major * 10000); diff --git a/lib/private/legacy/template/functions.php b/lib/private/legacy/template/functions.php index f427642b61..e42ef796f0 100644 --- a/lib/private/legacy/template/functions.php +++ b/lib/private/legacy/template/functions.php @@ -235,7 +235,7 @@ function link_to_docs($key) { * For further information have a look at \OCP\IURLGenerator::imagePath */ function image_path($app, $image) { - return \OC::$server->getURLGenerator()->imagePath( $app, $image ); + return \OC::$server->getURLGenerator()->imagePath($app, $image); } /** @@ -244,7 +244,7 @@ function image_path($app, $image) { * @return string link to the image */ function mimetype_icon($mimetype) { - return \OC::$server->getMimeTypeDetector()->mimeTypeIcon( $mimetype ); + return \OC::$server->getMimeTypeDetector()->mimeTypeIcon($mimetype); } /** @@ -274,7 +274,7 @@ function publicPreview_icon($path, $token) { * For further information have a look at OC_Helper::humanFileSize */ function human_file_size($bytes) { - return OC_Helper::humanFileSize( $bytes ); + return OC_Helper::humanFileSize($bytes); } /** diff --git a/lib/public/App.php b/lib/public/App.php index 7d55729c47..8e4a983c6b 100644 --- a/lib/public/App.php +++ b/lib/public/App.php @@ -57,7 +57,7 @@ class App { * @deprecated 14.0.0 Use settings section in appinfo.xml to register personal admin sections */ public static function registerPersonal($app, $page) { - \OC_App::registerPersonal( $app, $page ); + \OC_App::registerPersonal($app, $page); } /** @@ -69,7 +69,7 @@ class App { * @deprecated 14.0.0 Use settings section in appinfo.xml to register admin sections */ public static function registerAdmin($app, $page) { - \OC_App::registerAdmin( $app, $page ); + \OC_App::registerAdmin($app, $page); } /** @@ -81,7 +81,7 @@ class App { * @since 4.0.0 */ public static function getAppInfo($app, $path=false) { - return \OC_App::getAppInfo( $app, $path); + return \OC_App::getAppInfo($app, $path); } /** @@ -94,7 +94,7 @@ class App { * @deprecated 13.0.0 use \OC::$server->getAppManager()->isEnabledForUser($appId) */ public static function isEnabled($app) { - return \OC::$server->getAppManager()->isEnabledForUser( $app ); + return \OC::$server->getAppManager()->isEnabledForUser($app); } /** diff --git a/lib/public/AppFramework/Db/Mapper.php b/lib/public/AppFramework/Db/Mapper.php index 6d35c99d67..289ac1d684 100644 --- a/lib/public/AppFramework/Db/Mapper.php +++ b/lib/public/AppFramework/Db/Mapper.php @@ -285,7 +285,7 @@ abstract class Mapper { $row2 = $stmt->fetch(); $stmt->closeCursor(); //MDB2 returns null, PDO and doctrine false when no row is available - if( ! ($row2 === false || $row2 === null )) { + if(! ($row2 === false || $row2 === null)) { $msg = $this->buildDebugMessage( 'Did not expect more than one result when executing', $sql, $params, $limit, $offset ); diff --git a/lib/public/AppFramework/Db/QBMapper.php b/lib/public/AppFramework/Db/QBMapper.php index d26fb09072..c7b4b87765 100644 --- a/lib/public/AppFramework/Db/QBMapper.php +++ b/lib/public/AppFramework/Db/QBMapper.php @@ -261,7 +261,7 @@ abstract class QBMapper { $row2 = $cursor->fetch(); $cursor->closeCursor(); - if($row2 !== false ) { + if($row2 !== false) { $msg = $this->buildDebugMessage( 'Did not expect more than one result when executing', $query ); diff --git a/lib/public/Files.php b/lib/public/Files.php index adadbcd7ab..a1ff8a6d5a 100644 --- a/lib/public/Files.php +++ b/lib/public/Files.php @@ -55,7 +55,7 @@ class Files { * @deprecated 14.0.0 */ static public function rmdirr($dir) { - return \OC_Helper::rmdirr( $dir ); + return \OC_Helper::rmdirr($dir); } /** @@ -90,7 +90,7 @@ class Files { * @deprecated 14.0.0 */ public static function streamCopy($source, $target) { - list($count, ) = \OC_Helper::streamCopy( $source, $target ); + list($count, ) = \OC_Helper::streamCopy($source, $target); return $count; } @@ -115,6 +115,6 @@ class Files { * @deprecated 14.0.0 use IAppData instead */ public static function getStorage($app) { - return \OC_App::getStorage( $app ); + return \OC_App::getStorage($app); } } diff --git a/lib/public/Util.php b/lib/public/Util.php index 99161dfd72..4427e39b24 100644 --- a/lib/public/Util.php +++ b/lib/public/Util.php @@ -171,7 +171,7 @@ class Util { * @since 4.0.0 */ public static function addStyle($application, $file = null) { - \OC_Util::addStyle( $application, $file ); + \OC_Util::addStyle($application, $file); } /** @@ -181,7 +181,7 @@ class Util { * @since 4.0.0 */ public static function addScript($application, $file = null) { - \OC_Util::addScript( $application, $file ); + \OC_Util::addScript($application, $file); } /** diff --git a/remote.php b/remote.php index a83238d883..3e2398a062 100644 --- a/remote.php +++ b/remote.php @@ -76,7 +76,7 @@ function handleException($e) { $server->exec(); } else { $statusCode = 500; - if ($e instanceof \OC\ServiceUnavailableException ) { + if ($e instanceof \OC\ServiceUnavailableException) { $statusCode = 503; } if ($e instanceof RemoteException) { diff --git a/tests/Core/Controller/ClientFlowLoginControllerTest.php b/tests/Core/Controller/ClientFlowLoginControllerTest.php index a997546270..bc86c262d9 100644 --- a/tests/Core/Controller/ClientFlowLoginControllerTest.php +++ b/tests/Core/Controller/ClientFlowLoginControllerTest.php @@ -407,7 +407,7 @@ class ClientFlowLoginControllerTest extends TestCase { * ["https://example.com/redirect.php?hello=world", "https://example.com/redirect.php?hello=world&state=MyOauthState&code=MyAccessCode"] * */ - public function testGeneratePasswordWithPasswordForOauthClient($redirectUri, $redirectUrl) { + public function testGeneratePasswordWithPasswordForOauthClient($redirectUri, $redirectUrl) { $this->session ->expects($this->at(0)) ->method('get') diff --git a/tests/acceptance/features/bootstrap/AppSettingsContext.php b/tests/acceptance/features/bootstrap/AppSettingsContext.php index 5cf54cb528..5b51e55e11 100644 --- a/tests/acceptance/features/bootstrap/AppSettingsContext.php +++ b/tests/acceptance/features/bootstrap/AppSettingsContext.php @@ -90,7 +90,7 @@ class AppSettingsContext implements Context, ActorAwareInterface { } $this->actor->find($locator)->click(); - } + } /** * @Then I see that the settings are opened diff --git a/tests/lib/App/DependencyAnalyzerTest.php b/tests/lib/App/DependencyAnalyzerTest.php index 9ac44b97cc..40cd308f88 100644 --- a/tests/lib/App/DependencyAnalyzerTest.php +++ b/tests/lib/App/DependencyAnalyzerTest.php @@ -32,24 +32,24 @@ class DependencyAnalyzerTest extends TestCase { ->getMock(); $this->platformMock->expects($this->any()) ->method('getPhpVersion') - ->willReturn( '5.4.3'); + ->willReturn('5.4.3'); $this->platformMock->expects($this->any()) ->method('getIntSize') - ->willReturn( '4'); + ->willReturn('4'); $this->platformMock->expects($this->any()) ->method('getDatabase') - ->willReturn( 'mysql'); + ->willReturn('mysql'); $this->platformMock->expects($this->any()) ->method('getOS') - ->willReturn( 'Linux'); + ->willReturn('Linux'); $this->platformMock->expects($this->any()) ->method('isCommandKnown') - ->willReturnCallback( function ($command) { + ->willReturnCallback(function ($command) { return ($command === 'grep'); }); $this->platformMock->expects($this->any()) ->method('getLibraryVersion') - ->willReturnCallback( function ($lib) { + ->willReturnCallback(function ($lib) { if ($lib === 'curl') { return "2.3.4"; } @@ -57,7 +57,7 @@ class DependencyAnalyzerTest extends TestCase { }); $this->platformMock->expects($this->any()) ->method('getOcVersion') - ->willReturn( '8.0.2'); + ->willReturn('8.0.2'); $this->l10nMock = $this->getMockBuilder(IL10N::class) ->disableOriginalConstructor() diff --git a/tests/lib/AppFramework/Http/RedirectResponseTest.php b/tests/lib/AppFramework/Http/RedirectResponseTest.php index b211df1846..3c210092ca 100644 --- a/tests/lib/AppFramework/Http/RedirectResponseTest.php +++ b/tests/lib/AppFramework/Http/RedirectResponseTest.php @@ -42,7 +42,7 @@ class RedirectResponseTest extends \Test\TestCase { public function testHeaders() { $headers = $this->response->getHeaders(); $this->assertEquals('/url', $headers['Location']); - $this->assertEquals(Http::STATUS_SEE_OTHER, + $this->assertEquals(Http::STATUS_SEE_OTHER, $this->response->getStatus()); } diff --git a/tests/lib/AutoLoaderTest.php b/tests/lib/AutoLoaderTest.php index b3ca21a90d..24eaa36743 100644 --- a/tests/lib/AutoLoaderTest.php +++ b/tests/lib/AutoLoaderTest.php @@ -21,7 +21,7 @@ class AutoLoaderTest extends TestCase { public function testLegacyPath() { $this->assertEquals([ - \OC::$SERVERROOT . '/lib/private/legacy/files.php', + \OC::$SERVERROOT . '/lib/private/legacy/files.php', ], $this->loader->findClass('OC_Files')); } @@ -33,7 +33,7 @@ class AutoLoaderTest extends TestCase { public function testLoadCore() { $this->assertEquals([ - \OC::$SERVERROOT . '/lib/private/legacy/foo/bar.php', + \OC::$SERVERROOT . '/lib/private/legacy/foo/bar.php', ], $this->loader->findClass('OC_Foo_Bar')); } diff --git a/tests/lib/DB/DBSchemaTest.php b/tests/lib/DB/DBSchemaTest.php index 5fb68fdf25..4b249d07c4 100644 --- a/tests/lib/DB/DBSchemaTest.php +++ b/tests/lib/DB/DBSchemaTest.php @@ -39,12 +39,12 @@ class DBSchemaTest extends TestCase { $r = '_' . \OC::$server->getSecureRandom()-> generate(4, ISecureRandom::CHAR_LOWER . ISecureRandom::CHAR_DIGITS) . '_'; - $content = file_get_contents( $dbfile ); - $content = str_replace( '*dbprefix*', '*dbprefix*'.$r, $content ); - file_put_contents( $this->schema_file, $content ); - $content = file_get_contents( $dbfile2 ); - $content = str_replace( '*dbprefix*', '*dbprefix*'.$r, $content ); - file_put_contents( $this->schema_file2, $content ); + $content = file_get_contents($dbfile); + $content = str_replace('*dbprefix*', '*dbprefix*'.$r, $content); + file_put_contents($this->schema_file, $content); + $content = file_get_contents($dbfile2); + $content = str_replace('*dbprefix*', '*dbprefix*'.$r, $content); + file_put_contents($this->schema_file2, $content); $this->table1 = $r.'cntcts_addrsbks'; $this->table2 = $r.'cntcts_cards'; diff --git a/tests/lib/DB/LegacyDBTest.php b/tests/lib/DB/LegacyDBTest.php index cd4befdbe5..cf4c746a4d 100644 --- a/tests/lib/DB/LegacyDBTest.php +++ b/tests/lib/DB/LegacyDBTest.php @@ -62,9 +62,9 @@ class LegacyDBTest extends \Test\TestCase { $dbFile = \OC::$SERVERROOT.'/tests/data/db_structure.xml'; $r = $this->getUniqueID('_', 4).'_'; - $content = file_get_contents( $dbFile ); - $content = str_replace( '*dbprefix*', '*dbprefix*'.$r, $content ); - file_put_contents( self::$schema_file, $content ); + $content = file_get_contents($dbFile); + $content = str_replace('*dbprefix*', '*dbprefix*'.$r, $content); + file_put_contents(self::$schema_file, $content); OC_DB::createDbFromStructure(self::$schema_file); $this->test_prefix = $r; diff --git a/tests/lib/DB/SchemaDiffTest.php b/tests/lib/DB/SchemaDiffTest.php index 7896369857..c98cf173d8 100644 --- a/tests/lib/DB/SchemaDiffTest.php +++ b/tests/lib/DB/SchemaDiffTest.php @@ -72,7 +72,7 @@ class SchemaDiffTest extends TestCase { */ public function testZeroChangeOnSchemaMigrations($xml) { - $xml = str_replace( '*dbprefix*', $this->testPrefix, $xml ); + $xml = str_replace('*dbprefix*', $this->testPrefix, $xml); $schemaFile = $this->schemaFile; file_put_contents($schemaFile, $xml); diff --git a/tests/lib/Files/Stream/EncryptionTest.php b/tests/lib/Files/Stream/EncryptionTest.php index 5eab39efba..f884aefb7d 100644 --- a/tests/lib/Files/Stream/EncryptionTest.php +++ b/tests/lib/Files/Stream/EncryptionTest.php @@ -59,7 +59,7 @@ class EncryptionTest extends \Test\TestCase { 'fileid' => 5, 'encryptedVersion' => 2, ]); - $cache->expects($this->any())->method('get')->willReturn($entry ); + $cache->expects($this->any())->method('get')->willReturn($entry); $cache->expects($this->any())->method('update')->with(5, ['encrypted' => 3, 'encryptedVersion' => 3]); diff --git a/tests/lib/Log/FileTest.php b/tests/lib/Log/FileTest.php index 0bbcdc0a23..35e118bf3b 100644 --- a/tests/lib/Log/FileTest.php +++ b/tests/lib/Log/FileTest.php @@ -47,7 +47,7 @@ class FileTest extends TestCase $config->getValue("logfile", $this->restore_logfile); } else { $config->deleteValue("logfile"); - } + } if (isset($this->restore_logdateformat)) { $config->getValue("logdateformat", $this->restore_logdateformat); } else { diff --git a/tests/lib/Preview/HEICTest.php b/tests/lib/Preview/HEICTest.php index f75ae3192a..ea937f4df3 100644 --- a/tests/lib/Preview/HEICTest.php +++ b/tests/lib/Preview/HEICTest.php @@ -31,7 +31,7 @@ namespace Test\Preview; class HEICTest extends Provider { protected function setUp(): void { - if ( !in_array("HEIC", \Imagick::queryFormats("HEI*")) ) { + if (!in_array("HEIC", \Imagick::queryFormats("HEI*"))) { $this->markTestSkipped('ImageMagick is not HEIC aware. Skipping tests'); } else { parent::setUp(); diff --git a/tests/lib/SubAdminTest.php b/tests/lib/SubAdminTest.php index b2c1589439..23207c8f72 100644 --- a/tests/lib/SubAdminTest.php +++ b/tests/lib/SubAdminTest.php @@ -113,7 +113,7 @@ class SubAdminTest extends \Test\TestCase { ->fetch(); $this->assertEquals( [ - 'gid' => $this->groups[0]->getGID(), + 'gid' => $this->groups[0]->getGID(), 'uid' => $this->users[0]->getUID() ], $result); diff --git a/tests/lib/TestCase.php b/tests/lib/TestCase.php index 9d3070a0e2..c4ff92c223 100644 --- a/tests/lib/TestCase.php +++ b/tests/lib/TestCase.php @@ -449,7 +449,7 @@ abstract class TestCase extends \PHPUnit\Framework\TestCase { } $annotations = $this->getAnnotations(); if (isset($annotations['class']['group'])) { - if(in_array('DB', $annotations['class']['group']) || in_array('SLOWDB', $annotations['class']['group']) ) { + if(in_array('DB', $annotations['class']['group']) || in_array('SLOWDB', $annotations['class']['group'])) { return true; } } @@ -516,7 +516,7 @@ abstract class TestCase extends \PHPUnit\Framework\TestCase { if($node->hasChildNodes()) { $this->removeWhitespaces($node); } else { - if ($node instanceof \DOMText && $node->isWhitespaceInElementContent() ) { + if ($node instanceof \DOMText && $node->isWhitespaceInElementContent()) { $domNode->removeChild($node); } } From a8a06a82d2b93c17b3014f0d468f23239100ca10 Mon Sep 17 00:00:00 2001 From: Christoph Wurst Date: Thu, 9 Apr 2020 16:09:23 +0200 Subject: [PATCH 3/6] Remove trailing whitespaces from comments Signed-off-by: Christoph Wurst --- .../SystemTagsObjectMappingCollection.php | 2 +- apps/files_external/templates/settings.php | 2 +- apps/files_versions/lib/Expiration.php | 2 +- apps/user_ldap/lib/Configuration.php | 4 ++-- apps/user_ldap/lib/LDAPProvider.php | 4 ++-- .../Integration/ExceptionOnLostConnection.php | 2 +- core/templates/installation.php | 2 +- lib/private/ContactsManager.php | 4 ++-- lib/private/DateTimeZone.php | 2 +- lib/private/Search/Result/Audio.php | 2 +- lib/private/Search/Result/File.php | 6 +++--- lib/private/Search/Result/Folder.php | 2 +- lib/private/Search/Result/Image.php | 2 +- .../Authentication/TwoFactorAuth/IRegistry.php | 2 +- lib/public/Contacts/IManager.php | 6 +++--- lib/public/Diagnostics/IQueryLogger.php | 16 ++++++++-------- lib/public/LDAP/ILDAPProvider.php | 2 +- lib/public/Search/Result.php | 2 +- lib/public/Security/ISecureRandom.php | 2 +- .../features/bootstrap/AppNavigationContext.php | 4 ++-- .../features/bootstrap/AppSettingsContext.php | 4 ++-- .../features/bootstrap/DialogContext.php | 2 +- .../features/bootstrap/SettingsMenuContext.php | 2 +- 23 files changed, 39 insertions(+), 39 deletions(-) diff --git a/apps/dav/lib/SystemTag/SystemTagsObjectMappingCollection.php b/apps/dav/lib/SystemTag/SystemTagsObjectMappingCollection.php index 712a18d5db..bb74884419 100644 --- a/apps/dav/lib/SystemTag/SystemTagsObjectMappingCollection.php +++ b/apps/dav/lib/SystemTag/SystemTagsObjectMappingCollection.php @@ -189,7 +189,7 @@ class SystemTagsObjectMappingCollection implements ICollection { } /** - * Create a sabre node for the mapping of the + * Create a sabre node for the mapping of the * given system tag to the collection's object * * @param ISystemTag $tag diff --git a/apps/files_external/templates/settings.php b/apps/files_external/templates/settings.php index 04c33f73b8..5ec7003121 100644 --- a/apps/files_external/templates/settings.php +++ b/apps/files_external/templates/settings.php @@ -142,7 +142,7 @@ }); ?> - getDeprecateTo()) continue; // ignore deprecated backends ?> + getDeprecateTo()) continue; // ignore deprecated backends?> diff --git a/apps/files_versions/lib/Expiration.php b/apps/files_versions/lib/Expiration.php index d57bc20dc8..a56042e76b 100644 --- a/apps/files_versions/lib/Expiration.php +++ b/apps/files_versions/lib/Expiration.php @@ -129,7 +129,7 @@ class Expiration { } /** - * Read versions_retention_obligation, validate it + * Read versions_retention_obligation, validate it * and set private members accordingly */ private function parseRetentionObligation() { diff --git a/apps/user_ldap/lib/Configuration.php b/apps/user_ldap/lib/Configuration.php index a04ea638d0..3c6693b151 100644 --- a/apps/user_ldap/lib/Configuration.php +++ b/apps/user_ldap/lib/Configuration.php @@ -311,7 +311,7 @@ class Configuration { /** * Sets multi-line values as arrays - * + * * @param string $varName name of config-key * @param array|string $value to set */ @@ -387,7 +387,7 @@ class Configuration { /** * Sets a scalar value. - * + * * @param string $varName name of config key * @param mixed $value to set */ diff --git a/apps/user_ldap/lib/LDAPProvider.php b/apps/user_ldap/lib/LDAPProvider.php index 3119bcb013..75267165cd 100644 --- a/apps/user_ldap/lib/LDAPProvider.php +++ b/apps/user_ldap/lib/LDAPProvider.php @@ -114,7 +114,7 @@ class LDAPProvider implements ILDAPProvider, IDeletionFlagSupport { } /** - * Translate a LDAP DN to an internal user name. If there is no mapping between + * Translate a LDAP DN to an internal user name. If there is no mapping between * the DN and the user name, a new one will be created. * @param string $dn LDAP DN * @return string with the internal user name @@ -147,7 +147,7 @@ class LDAPProvider implements ILDAPProvider, IDeletionFlagSupport { } /** - * Return a new LDAP connection resource for the specified user. + * Return a new LDAP connection resource for the specified user. * The connection must be closed manually. * @param string $uid user id * @return resource of the LDAP connection diff --git a/apps/user_ldap/tests/Integration/ExceptionOnLostConnection.php b/apps/user_ldap/tests/Integration/ExceptionOnLostConnection.php index 50c45b4904..33eb1c70d6 100644 --- a/apps/user_ldap/tests/Integration/ExceptionOnLostConnection.php +++ b/apps/user_ldap/tests/Integration/ExceptionOnLostConnection.php @@ -36,7 +36,7 @@ use OCA\User_LDAP\LDAP; * * LDAP must be available via toxiproxy. * - * This test must be run manually. + * This test must be run manually. * */ class ExceptionOnLostConnection { diff --git a/core/templates/installation.php b/core/templates/installation.php index d5eec7f309..2919884a0e 100644 --- a/core/templates/installation.php +++ b/core/templates/installation.php @@ -75,7 +75,7 @@ script('core', [ 0): ?>
+ $hasOtherDB = true; else $hasOtherDB =false; //other than SQLite?> t('Configure the database')); ?>
$label): ?> diff --git a/lib/private/ContactsManager.php b/lib/private/ContactsManager.php index 2913e2b586..314304c7a8 100644 --- a/lib/private/ContactsManager.php +++ b/lib/private/ContactsManager.php @@ -125,7 +125,7 @@ namespace OC { /** * Return a list of the user's addressbooks display names * ! The addressBook displayName are not unique, please use getUserAddressBooks - * + * * @return array * @since 6.0.0 * @deprecated 16.0.0 - Use `$this->getUserAddressBooks()` instead @@ -142,7 +142,7 @@ namespace OC { /** * Return a list of the user's addressbooks - * + * * @return IAddressBook[] * @since 16.0.0 */ diff --git a/lib/private/DateTimeZone.php b/lib/private/DateTimeZone.php index d12dbdf2a3..971a1a9733 100644 --- a/lib/private/DateTimeZone.php +++ b/lib/private/DateTimeZone.php @@ -119,7 +119,7 @@ class DateTimeZone implements IDateTimeZone { * Get the default timezone of the server * * Falls back to UTC if it is not yet set. - * + * * @return string */ protected function getDefaultTimeZone() { diff --git a/lib/private/Search/Result/Audio.php b/lib/private/Search/Result/Audio.php index a035f51b38..67a6add04b 100644 --- a/lib/private/Search/Result/Audio.php +++ b/lib/private/Search/Result/Audio.php @@ -31,7 +31,7 @@ class Audio extends File { /** * Type name; translated in templates - * @var string + * @var string */ public $type = 'audio'; diff --git a/lib/private/Search/Result/File.php b/lib/private/Search/Result/File.php index 0b7e11f2fc..cd605c4982 100644 --- a/lib/private/Search/Result/File.php +++ b/lib/private/Search/Result/File.php @@ -35,7 +35,7 @@ class File extends \OCP\Search\Result { /** * Type name; translated in templates - * @var string + * @var string */ public $type = 'file'; @@ -47,7 +47,7 @@ class File extends \OCP\Search\Result { /** * Size, in bytes - * @var int + * @var int */ public $size; @@ -65,7 +65,7 @@ class File extends \OCP\Search\Result { /** * File permissions: - * + * * @var string */ public $permissions; diff --git a/lib/private/Search/Result/Folder.php b/lib/private/Search/Result/Folder.php index 1626f9d67d..0a746221ee 100644 --- a/lib/private/Search/Result/Folder.php +++ b/lib/private/Search/Result/Folder.php @@ -31,7 +31,7 @@ class Folder extends File { /** * Type name; translated in templates - * @var string + * @var string */ public $type = 'folder'; diff --git a/lib/private/Search/Result/Image.php b/lib/private/Search/Result/Image.php index 02973855ef..21123a4de1 100644 --- a/lib/private/Search/Result/Image.php +++ b/lib/private/Search/Result/Image.php @@ -31,7 +31,7 @@ class Image extends File { /** * Type name; translated in templates - * @var string + * @var string */ public $type = 'image'; diff --git a/lib/public/Authentication/TwoFactorAuth/IRegistry.php b/lib/public/Authentication/TwoFactorAuth/IRegistry.php index 9c10e86b5f..70026ca1da 100644 --- a/lib/public/Authentication/TwoFactorAuth/IRegistry.php +++ b/lib/public/Authentication/TwoFactorAuth/IRegistry.php @@ -31,7 +31,7 @@ use OCP\IUser; /** * Nextcloud 2FA provider registry for stateful 2FA providers - * + * * This service keeps track of which providers are currently active for a specific * user. Stateful 2FA providers (IStatefulProvider) must use this service to save * their enabled/disabled state. diff --git a/lib/public/Contacts/IManager.php b/lib/public/Contacts/IManager.php index 45baa127ee..dcb4c7ddbb 100644 --- a/lib/public/Contacts/IManager.php +++ b/lib/public/Contacts/IManager.php @@ -160,7 +160,7 @@ interface IManager { /** * Return a list of the user's addressbooks display names - * + * * @return array * @since 6.0.0 * @deprecated 16.0.0 - Use `$this->getUserAddressBooks()` instead @@ -169,7 +169,7 @@ interface IManager { /** * Return a list of the user's addressbooks - * + * * @return IAddressBook[] * @since 16.0.0 */ @@ -177,7 +177,7 @@ interface IManager { /** * removes all registered address book instances - * + * * @return void * @since 6.0.0 */ diff --git a/lib/public/Diagnostics/IQueryLogger.php b/lib/public/Diagnostics/IQueryLogger.php index 14628c5688..5a5656a6bc 100644 --- a/lib/public/Diagnostics/IQueryLogger.php +++ b/lib/public/Diagnostics/IQueryLogger.php @@ -35,10 +35,10 @@ use Doctrine\DBAL\Logging\SQLLogger; */ interface IQueryLogger extends SQLLogger { /** - * Mark the start of a query providing query SQL statement, its parameters and types. - * This method should be called as close to the DB as possible and after - * query is finished finalized with stopQuery() method. - * + * Mark the start of a query providing query SQL statement, its parameters and types. + * This method should be called as close to the DB as possible and after + * query is finished finalized with stopQuery() method. + * * @param string $sql * @param array|null $params * @param array|null $types @@ -49,7 +49,7 @@ interface IQueryLogger extends SQLLogger { /** * Mark the end of the current active query. Ending query should store \OCP\Diagnostics\IQuery to * be returned with getQueries() method. - * + * * @return mixed * @since 8.0.0 */ @@ -58,7 +58,7 @@ interface IQueryLogger extends SQLLogger { /** * This method should return all \OCP\Diagnostics\IQuery objects stored using * startQuery()/stopQuery() methods. - * + * * @return \OCP\Diagnostics\IQuery[] * @since 8.0.0 */ @@ -67,8 +67,8 @@ interface IQueryLogger extends SQLLogger { /** * Activate the module for the duration of the request. Deactivated module * does not create and store \OCP\Diagnostics\IQuery objects. - * Only activated module should create and store objects to be - * returned with getQueries() call. + * Only activated module should create and store objects to be + * returned with getQueries() call. * * @since 12.0.0 */ diff --git a/lib/public/LDAP/ILDAPProvider.php b/lib/public/LDAP/ILDAPProvider.php index 25127987ee..491906e555 100644 --- a/lib/public/LDAP/ILDAPProvider.php +++ b/lib/public/LDAP/ILDAPProvider.php @@ -76,7 +76,7 @@ interface ILDAPProvider { public function sanitizeDN($dn); /** - * Return a new LDAP connection resource for the specified user. + * Return a new LDAP connection resource for the specified user. * @param string $uid user id * @return resource of the LDAP connection * @since 11.0.0 diff --git a/lib/public/Search/Result.php b/lib/public/Search/Result.php index 0cbeb114af..8d9a4e5d23 100644 --- a/lib/public/Search/Result.php +++ b/lib/public/Search/Result.php @@ -56,7 +56,7 @@ class Result { /** * The type of search result returned; for consistency, name this the same - * as the class name (e.g. \OC\Search\File -> 'file') in lowercase. + * as the class name (e.g. \OC\Search\File -> 'file') in lowercase. * @var string * @since 7.0.0 */ diff --git a/lib/public/Security/ISecureRandom.php b/lib/public/Security/ISecureRandom.php index c2d149feaf..3fbc6c8ee1 100644 --- a/lib/public/Security/ISecureRandom.php +++ b/lib/public/Security/ISecureRandom.php @@ -51,7 +51,7 @@ interface ISecureRandom { /** * Characters that can be used for generate($length, $characters), to - * generate human readable random strings. Lower- and upper-case characters and digits + * generate human readable random strings. Lower- and upper-case characters and digits * are included. Characters which are ambiguous are excluded, such as I, l, and 1 and so on. */ const CHAR_HUMAN_READABLE = 'abcdefgijkmnopqrstwxyzABCDEFGHJKLMNPQRSTWXYZ23456789'; diff --git a/tests/acceptance/features/bootstrap/AppNavigationContext.php b/tests/acceptance/features/bootstrap/AppNavigationContext.php index 02a8b1c015..0fd9e92e9e 100644 --- a/tests/acceptance/features/bootstrap/AppNavigationContext.php +++ b/tests/acceptance/features/bootstrap/AppNavigationContext.php @@ -1,10 +1,10 @@ - * + * * @license GNU AGPL version 3 or any later version * * This program is free software: you can redistribute it and/or modify diff --git a/tests/acceptance/features/bootstrap/AppSettingsContext.php b/tests/acceptance/features/bootstrap/AppSettingsContext.php index 5b51e55e11..a75cce2993 100644 --- a/tests/acceptance/features/bootstrap/AppSettingsContext.php +++ b/tests/acceptance/features/bootstrap/AppSettingsContext.php @@ -1,10 +1,10 @@ - * + * * @license GNU AGPL version 3 or any later version * * This program is free software: you can redistribute it and/or modify diff --git a/tests/acceptance/features/bootstrap/DialogContext.php b/tests/acceptance/features/bootstrap/DialogContext.php index 8f387992b5..0558123ad9 100644 --- a/tests/acceptance/features/bootstrap/DialogContext.php +++ b/tests/acceptance/features/bootstrap/DialogContext.php @@ -1,7 +1,7 @@ * * @license GNU AGPL version 3 or any later version diff --git a/tests/acceptance/features/bootstrap/SettingsMenuContext.php b/tests/acceptance/features/bootstrap/SettingsMenuContext.php index e4e20997fc..a740e98756 100644 --- a/tests/acceptance/features/bootstrap/SettingsMenuContext.php +++ b/tests/acceptance/features/bootstrap/SettingsMenuContext.php @@ -103,7 +103,7 @@ class SettingsMenuContext implements Context, ActorAwareInterface { } /** - * @return array + * @return array */ public function menuItems() { return $this->actor->find(self::settingsMenu(), 10) From bcd13296def0ac8b8fb48067472f1019d5715895 Mon Sep 17 00:00:00 2001 From: Christoph Wurst Date: Thu, 9 Apr 2020 16:11:50 +0200 Subject: [PATCH 4/6] Make sure every file ends with an empty newline Signed-off-by: Christoph Wurst --- apps/files/list.php | 1 - apps/files/simplelist.php | 1 - apps/files_external/lib/Lib/Storage/SFTPWriteStream.php | 1 - apps/files_sharing/lib/Exceptions/SharingRightsException.php | 1 - apps/files_versions/appinfo/app.php | 1 - apps/files_versions/appinfo/routes.php | 1 - apps/systemtags/appinfo/app.php | 1 - apps/testing/appinfo/app.php | 1 - apps/theming/appinfo/app.php | 2 +- apps/theming/appinfo/routes.php | 1 - build/integration/features/bootstrap/Sharing.php | 1 - build/integration/features/bootstrap/Trashbin.php | 1 - build/signed-off-checker.php | 1 - lib/public/DirectEditing/IManager.php | 1 - ocm-provider/index.php | 1 - 15 files changed, 1 insertion(+), 15 deletions(-) diff --git a/apps/files/list.php b/apps/files/list.php index 7d7fc7f105..e4713ae296 100644 --- a/apps/files/list.php +++ b/apps/files/list.php @@ -37,4 +37,3 @@ $tmpl = new OCP\Template('files', 'list', ''); $tmpl->assign('showgridview', $showgridview && !$isIE); $tmpl->assign('publicUploadEnabled', $publicUploadEnabled); $tmpl->printPage(); - diff --git a/apps/files/simplelist.php b/apps/files/simplelist.php index 7bb6fb3455..eebb5beb51 100644 --- a/apps/files/simplelist.php +++ b/apps/files/simplelist.php @@ -35,4 +35,3 @@ $tmpl = new OCP\Template('files', 'simplelist', ''); // gridview not available for ie $tmpl->assign('showgridview', $showgridview && !$isIE); $tmpl->printPage(); - diff --git a/apps/files_external/lib/Lib/Storage/SFTPWriteStream.php b/apps/files_external/lib/Lib/Storage/SFTPWriteStream.php index cb693f82f7..b5bc3ab667 100644 --- a/apps/files_external/lib/Lib/Storage/SFTPWriteStream.php +++ b/apps/files_external/lib/Lib/Storage/SFTPWriteStream.php @@ -180,4 +180,3 @@ class SFTPWriteStream implements File { } } - diff --git a/apps/files_sharing/lib/Exceptions/SharingRightsException.php b/apps/files_sharing/lib/Exceptions/SharingRightsException.php index 868ead81e7..3df5754e0a 100644 --- a/apps/files_sharing/lib/Exceptions/SharingRightsException.php +++ b/apps/files_sharing/lib/Exceptions/SharingRightsException.php @@ -36,4 +36,3 @@ use Exception; class SharingRightsException extends Exception { } - diff --git a/apps/files_versions/appinfo/app.php b/apps/files_versions/appinfo/app.php index 0965085839..917b8831c0 100644 --- a/apps/files_versions/appinfo/app.php +++ b/apps/files_versions/appinfo/app.php @@ -22,4 +22,3 @@ */ \OC::$server->query(\OCA\Files_Versions\AppInfo\Application::class); - diff --git a/apps/files_versions/appinfo/routes.php b/apps/files_versions/appinfo/routes.php index 0149c0d3b0..7252ddcd22 100644 --- a/apps/files_versions/appinfo/routes.php +++ b/apps/files_versions/appinfo/routes.php @@ -46,4 +46,3 @@ $this->create('files_versions_ajax_getVersions', 'ajax/getVersions.php') ->actionInclude('files_versions/ajax/getVersions.php'); $this->create('files_versions_ajax_rollbackVersion', 'ajax/rollbackVersion.php') ->actionInclude('files_versions/ajax/rollbackVersion.php'); - diff --git a/apps/systemtags/appinfo/app.php b/apps/systemtags/appinfo/app.php index 3764ff4a88..e4bf9b91fa 100644 --- a/apps/systemtags/appinfo/app.php +++ b/apps/systemtags/appinfo/app.php @@ -69,4 +69,3 @@ $eventDispatcher->addListener(MapperEvent::EVENT_UNASSIGN, $mapperListener); 'name' => $l->t('Tags'), ]; }); - diff --git a/apps/testing/appinfo/app.php b/apps/testing/appinfo/app.php index ae8f9841b4..48d8da8c20 100644 --- a/apps/testing/appinfo/app.php +++ b/apps/testing/appinfo/app.php @@ -22,4 +22,3 @@ */ $app = new \OCA\Testing\AppInfo\Application(); - diff --git a/apps/theming/appinfo/app.php b/apps/theming/appinfo/app.php index 114ff60ba5..c942a85bc7 100644 --- a/apps/theming/appinfo/app.php +++ b/apps/theming/appinfo/app.php @@ -57,4 +57,4 @@ $linkToJs = \OC::$server->getURLGenerator()->linkToRoute( 'src' => $linkToJs, 'nonce' => \OC::$server->getContentSecurityPolicyNonceManager()->getNonce() ], '' -); \ No newline at end of file +); diff --git a/apps/theming/appinfo/routes.php b/apps/theming/appinfo/routes.php index fe7a5a9465..13196662eb 100644 --- a/apps/theming/appinfo/routes.php +++ b/apps/theming/appinfo/routes.php @@ -84,4 +84,3 @@ return ['routes' => [ 'requirements' => ['image' => '.+'] ], ]]; - diff --git a/build/integration/features/bootstrap/Sharing.php b/build/integration/features/bootstrap/Sharing.php index 590e0c4663..762e0dcb04 100644 --- a/build/integration/features/bootstrap/Sharing.php +++ b/build/integration/features/bootstrap/Sharing.php @@ -742,4 +742,3 @@ trait Sharing { return $sharees; } } - diff --git a/build/integration/features/bootstrap/Trashbin.php b/build/integration/features/bootstrap/Trashbin.php index c7bef76e95..b68048e7cc 100644 --- a/build/integration/features/bootstrap/Trashbin.php +++ b/build/integration/features/bootstrap/Trashbin.php @@ -167,4 +167,3 @@ trait Trashbin { return; } } - diff --git a/build/signed-off-checker.php b/build/signed-off-checker.php index 32deceb47b..43cf452947 100644 --- a/build/signed-off-checker.php +++ b/build/signed-off-checker.php @@ -127,4 +127,3 @@ if($notSignedCommits !== []) { } else { exit(0); } - diff --git a/lib/public/DirectEditing/IManager.php b/lib/public/DirectEditing/IManager.php index 33d4716fc6..e9548a91e7 100644 --- a/lib/public/DirectEditing/IManager.php +++ b/lib/public/DirectEditing/IManager.php @@ -87,4 +87,3 @@ interface IManager { public function cleanup(): int; } - diff --git a/ocm-provider/index.php b/ocm-provider/index.php index 079ef790fa..e1aa7f2b03 100644 --- a/ocm-provider/index.php +++ b/ocm-provider/index.php @@ -36,4 +36,3 @@ if ($isEnabled) { header($_SERVER["SERVER_PROTOCOL"]." 501 Not Implemented", true, 501); exit("501 Not Implemented"); } - From f4c09f299d989b117ebdf769632dcc6d4582791c Mon Sep 17 00:00:00 2001 From: Christoph Wurst Date: Thu, 9 Apr 2020 16:14:31 +0200 Subject: [PATCH 5/6] Make sure there is exactly one newline after imports Signed-off-by: Christoph Wurst --- apps/files_external/templates/settings.php | 8 ++++---- .../lib/Exceptions/SharingRightsException.php | 1 - apps/settings/tests/Settings/Admin/ServerTest.php | 1 - lib/private/Mail/Mailer.php | 1 - 4 files changed, 4 insertions(+), 7 deletions(-) diff --git a/apps/files_external/templates/settings.php b/apps/files_external/templates/settings.php index 5ec7003121..0142b206b3 100644 --- a/apps/files_external/templates/settings.php +++ b/apps/files_external/templates/settings.php @@ -1,10 +1,10 @@ t("Enable encryption"); $l->t("Enable previews"); diff --git a/apps/files_sharing/lib/Exceptions/SharingRightsException.php b/apps/files_sharing/lib/Exceptions/SharingRightsException.php index 3df5754e0a..02d197d403 100644 --- a/apps/files_sharing/lib/Exceptions/SharingRightsException.php +++ b/apps/files_sharing/lib/Exceptions/SharingRightsException.php @@ -25,7 +25,6 @@ namespace OCA\Files_Sharing\Exceptions; use Exception; - /** * Sharing and Resharing rights. * diff --git a/apps/settings/tests/Settings/Admin/ServerTest.php b/apps/settings/tests/Settings/Admin/ServerTest.php index 3758d8635d..d066f5c2f4 100644 --- a/apps/settings/tests/Settings/Admin/ServerTest.php +++ b/apps/settings/tests/Settings/Admin/ServerTest.php @@ -40,7 +40,6 @@ use OCP\IDBConnection; use PHPUnit\Framework\MockObject\MockObject; use Test\TestCase; - /** * @group DB */ diff --git a/lib/private/Mail/Mailer.php b/lib/private/Mail/Mailer.php index f8af68faad..c07556b6a6 100644 --- a/lib/private/Mail/Mailer.php +++ b/lib/private/Mail/Mailer.php @@ -47,7 +47,6 @@ use OCP\Mail\IMailer; use OCP\Mail\IMessage; use OCP\Mail\Events\BeforeMessageSent; - /** * Class Mailer provides some basic functions to create a mail message that can be used in combination with * \OC\Mail\Message. From 3a415e4139d6e28c16b0420ab411e6df5ff6d54a Mon Sep 17 00:00:00 2001 From: Christoph Wurst Date: Thu, 9 Apr 2020 16:17:53 +0200 Subject: [PATCH 6/6] Remove space between switch case and colon Signed-off-by: Christoph Wurst --- apps/dav/lib/CalDAV/CalDavBackend.php | 10 +-- .../lib/CalDAV/Publishing/PublishPlugin.php | 4 +- apps/dav/lib/CardDAV/CardDavBackend.php | 10 +-- apps/dav/lib/DAV/Sharing/Plugin.php | 2 +- apps/dav/lib/DAV/Sharing/Xml/ShareRequest.php | 4 +- lib/private/AppFramework/Http/Request.php | 6 +- lib/private/Color.php | 4 +- tests/lib/Group/ManagerTest.php | 64 +++++++++---------- 8 files changed, 53 insertions(+), 51 deletions(-) diff --git a/apps/dav/lib/CalDAV/CalDavBackend.php b/apps/dav/lib/CalDAV/CalDavBackend.php index f947ea9d01..a6f1cef709 100644 --- a/apps/dav/lib/CalDAV/CalDavBackend.php +++ b/apps/dav/lib/CalDAV/CalDavBackend.php @@ -805,11 +805,11 @@ class CalDavBackend extends AbstractBackend implements SyncSupport, Subscription foreach ($mutations as $propertyName => $propertyValue) { switch ($propertyName) { - case '{' . Plugin::NS_CALDAV . '}schedule-calendar-transp' : + case '{' . Plugin::NS_CALDAV . '}schedule-calendar-transp': $fieldName = 'transparent'; $newValues[$fieldName] = (int) ($propertyValue->getValue() === 'transparent'); break; - default : + default: $fieldName = $this->propertyMap[$propertyName]; $newValues[$fieldName] = $propertyValue; break; @@ -1812,13 +1812,13 @@ class CalDavBackend extends AbstractBackend implements SyncSupport, Subscription foreach($changes as $uri => $operation) { switch($operation) { - case 1 : + case 1: $result['added'][] = $uri; break; - case 2 : + case 2: $result['modified'][] = $uri; break; - case 3 : + case 3: $result['deleted'][] = $uri; break; } diff --git a/apps/dav/lib/CalDAV/Publishing/PublishPlugin.php b/apps/dav/lib/CalDAV/Publishing/PublishPlugin.php index 59b9731206..214fb79464 100644 --- a/apps/dav/lib/CalDAV/Publishing/PublishPlugin.php +++ b/apps/dav/lib/CalDAV/Publishing/PublishPlugin.php @@ -176,7 +176,7 @@ class PublishPlugin extends ServerPlugin { switch ($documentType) { - case '{'.self::NS_CALENDARSERVER.'}publish-calendar' : + case '{'.self::NS_CALENDARSERVER.'}publish-calendar': // We can only deal with IShareableCalendar objects if (!$node instanceof Calendar) { @@ -204,7 +204,7 @@ class PublishPlugin extends ServerPlugin { // Breaking the event chain return false; - case '{'.self::NS_CALENDARSERVER.'}unpublish-calendar' : + case '{'.self::NS_CALENDARSERVER.'}unpublish-calendar': // We can only deal with IShareableCalendar objects if (!$node instanceof Calendar) { diff --git a/apps/dav/lib/CardDAV/CardDavBackend.php b/apps/dav/lib/CardDAV/CardDavBackend.php index 1f44b63a57..54427404db 100644 --- a/apps/dav/lib/CardDAV/CardDavBackend.php +++ b/apps/dav/lib/CardDAV/CardDavBackend.php @@ -369,10 +369,10 @@ class CardDavBackend implements BackendInterface, SyncSupport { foreach($mutations as $property=>$newValue) { switch($property) { - case '{DAV:}displayname' : + case '{DAV:}displayname': $updates['displayname'] = $newValue; break; - case '{' . Plugin::NS_CARDDAV . '}addressbook-description' : + case '{' . Plugin::NS_CARDDAV . '}addressbook-description': $updates['description'] = $newValue; break; } @@ -414,13 +414,13 @@ class CardDavBackend implements BackendInterface, SyncSupport { foreach($properties as $property=>$newValue) { switch($property) { - case '{DAV:}displayname' : + case '{DAV:}displayname': $values['displayname'] = $newValue; break; - case '{' . Plugin::NS_CARDDAV . '}addressbook-description' : + case '{' . Plugin::NS_CARDDAV . '}addressbook-description': $values['description'] = $newValue; break; - default : + default: throw new BadRequest('Unknown property: ' . $property); } diff --git a/apps/dav/lib/DAV/Sharing/Plugin.php b/apps/dav/lib/DAV/Sharing/Plugin.php index fec26f145a..f0c2b82ccb 100644 --- a/apps/dav/lib/DAV/Sharing/Plugin.php +++ b/apps/dav/lib/DAV/Sharing/Plugin.php @@ -149,7 +149,7 @@ class Plugin extends ServerPlugin { // Dealing with the 'share' document, which modified invitees on a // calendar. - case '{' . self::NS_OWNCLOUD . '}share' : + case '{' . self::NS_OWNCLOUD . '}share': // We can only deal with IShareableCalendar objects if (!$node instanceof IShareable) { diff --git a/apps/dav/lib/DAV/Sharing/Xml/ShareRequest.php b/apps/dav/lib/DAV/Sharing/Xml/ShareRequest.php index b95c978cf1..c63bb4fe1d 100644 --- a/apps/dav/lib/DAV/Sharing/Xml/ShareRequest.php +++ b/apps/dav/lib/DAV/Sharing/Xml/ShareRequest.php @@ -59,7 +59,7 @@ class ShareRequest implements XmlDeserializable { foreach ($elements as $elem) { switch ($elem['name']) { - case '{' . Plugin::NS_OWNCLOUD . '}set' : + case '{' . Plugin::NS_OWNCLOUD . '}set': $sharee = $elem['value']; $sumElem = '{' . Plugin::NS_OWNCLOUD . '}summary'; @@ -73,7 +73,7 @@ class ShareRequest implements XmlDeserializable { ]; break; - case '{' . Plugin::NS_OWNCLOUD . '}remove' : + case '{' . Plugin::NS_OWNCLOUD . '}remove': $remove[] = $elem['value']['{DAV:}href']; break; diff --git a/lib/private/AppFramework/Http/Request.php b/lib/private/AppFramework/Http/Request.php index 41bfbd8250..9b8c0690ba 100644 --- a/lib/private/AppFramework/Http/Request.php +++ b/lib/private/AppFramework/Http/Request.php @@ -327,8 +327,8 @@ class Request implements \ArrayAccess, \Countable, IRequest { // There's a few headers that seem to end up in the top-level // server array. switch ($name) { - case 'CONTENT_TYPE' : - case 'CONTENT_LENGTH' : + case 'CONTENT_TYPE': + case 'CONTENT_LENGTH': case 'REMOTE_ADDR': if (isset($this->server[$name])) { return $this->server[$name]; @@ -811,7 +811,7 @@ class Request implements \ArrayAccess, \Countable, IRequest { $encoding = mb_detect_encoding($pathInfo, ['UTF-8', 'ISO-8859-1']); switch($encoding) { - case 'ISO-8859-1' : + case 'ISO-8859-1': $pathInfo = utf8_encode($pathInfo); } // end copy diff --git a/lib/private/Color.php b/lib/private/Color.php index 11f2c4ada4..6238831c41 100644 --- a/lib/private/Color.php +++ b/lib/private/Color.php @@ -24,7 +24,9 @@ namespace OC; class Color { - public $r, $g, $b; + public $r; + public $g; + public $b; public function __construct($r, $g, $b) { $this->r = $r; $this->g = $g; diff --git a/tests/lib/Group/ManagerTest.php b/tests/lib/Group/ManagerTest.php index c4b56b56ff..9437e62996 100644 --- a/tests/lib/Group/ManagerTest.php +++ b/tests/lib/Group/ManagerTest.php @@ -548,9 +548,9 @@ class ManagerTest extends TestCase { ->method('inGroup') ->willReturnCallback(function ($uid, $gid) { switch($uid) { - case 'user1' : return false; - case 'user2' : return true; - case 'user3' : return false; + case 'user1': return false; + case 'user2': return true; + case 'user3': return false; case 'user33': return true; default: return null; @@ -562,9 +562,9 @@ class ManagerTest extends TestCase { ->with('user3') ->willReturnCallback(function ($search, $limit, $offset) { switch($offset) { - case 0 : return ['user3' => $this->getTestUser('user3'), + case 0: return ['user3' => $this->getTestUser('user3'), 'user33' => $this->getTestUser('user33')]; - case 2 : return []; + case 2: return []; } return null; }); @@ -572,9 +572,9 @@ class ManagerTest extends TestCase { ->method('get') ->willReturnCallback(function ($uid) { switch($uid) { - case 'user1' : return $this->getTestUser('user1'); - case 'user2' : return $this->getTestUser('user2'); - case 'user3' : return $this->getTestUser('user3'); + case 'user1': return $this->getTestUser('user1'); + case 'user2': return $this->getTestUser('user2'); + case 'user3': return $this->getTestUser('user3'); case 'user33': return $this->getTestUser('user33'); default: return null; @@ -606,9 +606,9 @@ class ManagerTest extends TestCase { ->method('inGroup') ->willReturnCallback(function ($uid, $gid) { switch($uid) { - case 'user1' : return false; - case 'user2' : return true; - case 'user3' : return false; + case 'user1': return false; + case 'user2': return true; + case 'user3': return false; case 'user33': return true; case 'user333': return true; default: @@ -621,9 +621,9 @@ class ManagerTest extends TestCase { ->with('user3') ->willReturnCallback(function ($search, $limit, $offset) { switch($offset) { - case 0 : return ['user3' => $this->getTestUser('user3'), + case 0: return ['user3' => $this->getTestUser('user3'), 'user33' => $this->getTestUser('user33')]; - case 2 : return ['user333' => $this->getTestUser('user333')]; + case 2: return ['user333' => $this->getTestUser('user333')]; } return null; }); @@ -631,9 +631,9 @@ class ManagerTest extends TestCase { ->method('get') ->willReturnCallback(function ($uid) { switch($uid) { - case 'user1' : return $this->getTestUser('user1'); - case 'user2' : return $this->getTestUser('user2'); - case 'user3' : return $this->getTestUser('user3'); + case 'user1': return $this->getTestUser('user1'); + case 'user2': return $this->getTestUser('user2'); + case 'user3': return $this->getTestUser('user3'); case 'user33': return $this->getTestUser('user33'); case 'user333': return $this->getTestUser('user333'); default: @@ -667,9 +667,9 @@ class ManagerTest extends TestCase { ->method('inGroup') ->willReturnCallback(function ($uid) { switch($uid) { - case 'user1' : return false; - case 'user2' : return true; - case 'user3' : return false; + case 'user1': return false; + case 'user2': return true; + case 'user3': return false; case 'user33': return true; case 'user333': return true; default: @@ -682,7 +682,7 @@ class ManagerTest extends TestCase { ->with('user3') ->willReturnCallback(function ($search, $limit, $offset) { switch($offset) { - case 0 : + case 0: return [ 'user3' => $this->getTestUser('user3'), 'user33' => $this->getTestUser('user33'), @@ -695,9 +695,9 @@ class ManagerTest extends TestCase { ->method('get') ->willReturnCallback(function ($uid) { switch($uid) { - case 'user1' : return $this->getTestUser('user1'); - case 'user2' : return $this->getTestUser('user2'); - case 'user3' : return $this->getTestUser('user3'); + case 'user1': return $this->getTestUser('user1'); + case 'user2': return $this->getTestUser('user2'); + case 'user3': return $this->getTestUser('user3'); case 'user33': return $this->getTestUser('user33'); case 'user333': return $this->getTestUser('user333'); default: @@ -736,9 +736,9 @@ class ManagerTest extends TestCase { ->method('get') ->willReturnCallback(function ($uid) { switch($uid) { - case 'user1' : return $this->getTestUser('user1'); - case 'user2' : return $this->getTestUser('user2'); - case 'user3' : return $this->getTestUser('user3'); + case 'user1': return $this->getTestUser('user1'); + case 'user2': return $this->getTestUser('user2'); + case 'user3': return $this->getTestUser('user3'); case 'user33': return $this->getTestUser('user33'); default: return null; @@ -775,9 +775,9 @@ class ManagerTest extends TestCase { ->method('get') ->willReturnCallback(function ($uid) { switch($uid) { - case 'user1' : return $this->getTestUser('user1'); - case 'user2' : return $this->getTestUser('user2'); - case 'user3' : return $this->getTestUser('user3'); + case 'user1': return $this->getTestUser('user1'); + case 'user2': return $this->getTestUser('user2'); + case 'user3': return $this->getTestUser('user3'); case 'user33': return $this->getTestUser('user33'); default: return null; @@ -814,9 +814,9 @@ class ManagerTest extends TestCase { ->method('get') ->willReturnCallback(function ($uid) { switch($uid) { - case 'user1' : return $this->getTestUser('user1'); - case 'user2' : return $this->getTestUser('user2'); - case 'user3' : return $this->getTestUser('user3'); + case 'user1': return $this->getTestUser('user1'); + case 'user2': return $this->getTestUser('user2'); + case 'user3': return $this->getTestUser('user3'); case 'user33': return $this->getTestUser('user33'); default: return null;