From 534fb4f3ca01c44aaf8ed7b02b477150e0a9beb1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20M=C3=BCller?= Date: Wed, 25 Apr 2018 20:04:32 +0200 Subject: [PATCH 1/8] php-cs-fixer: adding combine_consecutive_issets and combine_consecutive_unsets --- .php_cs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.php_cs b/.php_cs index 5ff02615ee91..4a63c0d6612f 100644 --- a/.php_cs +++ b/.php_cs @@ -43,6 +43,8 @@ return PhpCsFixer\Config::create() 'native_function_invocation' => true, '@PSR1' => true, 'array_syntax' => ['syntax' => 'short'], + 'combine_consecutive_issets' => true, + 'combine_consecutive_unsets' => true, ]) ->setFinder($finder) ; \ No newline at end of file From 47f6da18c7d98da89310b8fda3f58500df9eb7f0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20M=C3=BCller?= Date: Wed, 25 Apr 2018 20:12:15 +0200 Subject: [PATCH 2/8] Applying new php-cs-fixer rules: combine_consecutive_issets and combine_consecutive_unsets --- apps/comments/lib/Dav/CommentsPlugin.php | 2 +- apps/dav/lib/Connector/Sabre/File.php | 2 +- apps/dav/tests/unit/Connector/Sabre/FileTest.php | 6 +++--- apps/files_external/lib/Lib/Storage/SMB.php | 2 +- core/ajax/share.php | 10 +++++----- lib/base.php | 2 +- lib/private/AppConfig.php | 2 +- lib/private/Comments/Comment.php | 2 +- lib/private/DB/MDB2SchemaReader.php | 2 +- lib/private/Files/Cache/Scanner.php | 2 +- lib/private/Files/Cache/Updater.php | 2 +- lib/private/Files/Storage/DAV.php | 2 +- lib/private/Files/Storage/Wrapper/Encoding.php | 8 ++++---- lib/private/Files/Type/Detection.php | 2 +- lib/private/NaturalSort.php | 2 +- lib/private/Server.php | 4 ++-- lib/private/Share/Share.php | 2 +- lib/private/User/Session.php | 6 +++--- lib/private/legacy/app.php | 4 ++-- 19 files changed, 32 insertions(+), 32 deletions(-) diff --git a/apps/comments/lib/Dav/CommentsPlugin.php b/apps/comments/lib/Dav/CommentsPlugin.php index 20c474412ece..b95e73bd20f3 100644 --- a/apps/comments/lib/Dav/CommentsPlugin.php +++ b/apps/comments/lib/Dav/CommentsPlugin.php @@ -187,7 +187,7 @@ public function onReport($reportName, $report, $uri) { foreach($results as $node) { $nodePath = $this->server->getRequestUri() . '/' . $node->comment->getId(); $resultSet = $this->server->getPropertiesForPath($nodePath, CommentNode::getPropertyNames()); - if(isset($resultSet[0]) && isset($resultSet[0][200])) { + if(isset($resultSet[0], $resultSet[0][200]) ) { $responses[] = new Response( $this->server->getBaseUri() . $nodePath, [200 => $resultSet[0][200]], diff --git a/apps/dav/lib/Connector/Sabre/File.php b/apps/dav/lib/Connector/Sabre/File.php index f229b378f91c..4af9c8e15d90 100644 --- a/apps/dav/lib/Connector/Sabre/File.php +++ b/apps/dav/lib/Connector/Sabre/File.php @@ -548,7 +548,7 @@ private function createFileChunked($data) { $info = $this->fileView->getFileInfo($targetPath); - if (isset($partStorage) && isset($partInternalPath)) { + if (isset($partStorage, $partInternalPath) ) { $checksums = $partStorage->getMetaData($partInternalPath)['checksum']; } else { $checksums = $targetStorage->getMetaData($targetInternalPath)['checksum']; diff --git a/apps/dav/tests/unit/Connector/Sabre/FileTest.php b/apps/dav/tests/unit/Connector/Sabre/FileTest.php index d934353f451b..b9ccab6ead59 100644 --- a/apps/dav/tests/unit/Connector/Sabre/FileTest.php +++ b/apps/dav/tests/unit/Connector/Sabre/FileTest.php @@ -71,9 +71,9 @@ class FileTest extends TestCase { public function setUp() { parent::setUp(); - unset($_SERVER['HTTP_OC_CHUNKED']); - unset($_SERVER['CONTENT_LENGTH']); - unset($_SERVER['REQUEST_METHOD']); + unset($_SERVER['HTTP_OC_CHUNKED'], $_SERVER['CONTENT_LENGTH'], $_SERVER['REQUEST_METHOD']); + + \OC_Hook::clear(); diff --git a/apps/files_external/lib/Lib/Storage/SMB.php b/apps/files_external/lib/Lib/Storage/SMB.php index 5a919743f01e..539d600314b1 100644 --- a/apps/files_external/lib/Lib/Storage/SMB.php +++ b/apps/files_external/lib/Lib/Storage/SMB.php @@ -76,7 +76,7 @@ public function __construct($params) { } $this->log('enter: '.__FUNCTION__.'('.\json_encode($loggedParams).')'); - if (isset($params['host']) && isset($params['user']) && isset($params['password']) && isset($params['share'])) { + if (isset($params['host'], $params['user'], $params['password'], $params['share']) ) { if (Server::NativeAvailable()) { $this->log('using native libsmbclient'); $this->server = new NativeServer($params['host'], $params['user'], $params['password']); diff --git a/core/ajax/share.php b/core/ajax/share.php index c5157d3df597..c83a34805e95 100644 --- a/core/ajax/share.php +++ b/core/ajax/share.php @@ -98,7 +98,7 @@ function usersInGroup($gid, $search = '', $limit = -1, $offset = 0) { } } -if (isset($_POST['action']) && isset($_POST['itemType']) && isset($_POST['itemSource'])) { +if (isset($_POST['action'], $_POST['itemType'], $_POST['itemSource']) ) { switch ($_POST['action']) { case 'informRecipients': $l = \OC::$server->getL10N('core'); @@ -271,10 +271,10 @@ function usersInGroup($gid, $search = '', $limit = -1, $offset = 0) { } break; case 'getItem': - if (isset($_GET['itemType']) - && isset($_GET['itemSource']) - && isset($_GET['checkReshare']) - && isset($_GET['checkShares'])) { + if (isset($_GET['itemType'], $_GET['itemSource'], $_GET['checkReshare'], $_GET['checkShares']) + + + ) { if ($_GET['checkReshare'] == 'true') { $reshare = OCP\Share::getItemSharedWithBySource( (string)$_GET['itemType'], diff --git a/lib/base.php b/lib/base.php index 701a5127291a..ff5ade766a5b 100644 --- a/lib/base.php +++ b/lib/base.php @@ -190,7 +190,7 @@ public static function initPaths() { $config_paths = self::$config->getValue('apps_paths', []); if (!empty($config_paths)) { foreach ($config_paths as $paths) { - if (isset($paths['url']) && isset($paths['path'])) { + if (isset($paths['url'], $paths['path']) ) { $paths['url'] = \rtrim($paths['url'], '/'); $paths['path'] = \rtrim($paths['path'], '/'); OC::$APPSROOTS[] = $paths; diff --git a/lib/private/AppConfig.php b/lib/private/AppConfig.php index 5fd197e932f8..cf0c6f86e6b1 100644 --- a/lib/private/AppConfig.php +++ b/lib/private/AppConfig.php @@ -191,7 +191,7 @@ public function setValue($app, $key, $value) { ->setParameter('configvalue', $value); } - if (isset($this->cache[$app]) && isset($this->cache[$app][$key])) { + if (isset($this->cache[$app], $this->cache[$app][$key]) ) { $afterArray['update'] = true; $afterArray['oldvalue'] = $this->cache[$app][$key]; } diff --git a/lib/private/Comments/Comment.php b/lib/private/Comments/Comment.php index 369945d8ef9e..d38f0bc08163 100644 --- a/lib/private/Comments/Comment.php +++ b/lib/private/Comments/Comment.php @@ -372,7 +372,7 @@ protected function fromArray($data) { } foreach(['actor', 'object'] as $role) { - if(isset($data[$role . '_type']) && isset($data[$role . '_id'])) { + if(isset($data[$role . '_type'], $data[$role.'_id']) ) { $setter = 'set' . \ucfirst($role); $this->$setter($data[$role . '_type'], $data[$role . '_id']); } diff --git a/lib/private/DB/MDB2SchemaReader.php b/lib/private/DB/MDB2SchemaReader.php index 21dfed79ead8..f32693d2b218 100644 --- a/lib/private/DB/MDB2SchemaReader.php +++ b/lib/private/DB/MDB2SchemaReader.php @@ -212,7 +212,7 @@ private function loadField($table, $xml) { } } - if (isset($name) && isset($type)) { + if (isset($name, $type) ) { if (isset($options['default']) && empty($options['default'])) { if (empty($options['notnull']) || !$options['notnull']) { unset($options['default']); diff --git a/lib/private/Files/Cache/Scanner.php b/lib/private/Files/Cache/Scanner.php index 100f30dbaabd..a92c9b8cfd88 100644 --- a/lib/private/Files/Cache/Scanner.php +++ b/lib/private/Files/Cache/Scanner.php @@ -189,7 +189,7 @@ public function scanFile($file, $reuseExisting = 0, $parentId = -1, $cacheData = $fileId = $cacheData['fileid']; $data['fileid'] = $fileId; // only reuse data if the file hasn't explicitly changed - if (isset($data['storage_mtime']) && isset($cacheData['storage_mtime']) && $data['storage_mtime'] === $cacheData['storage_mtime']) { + if (isset($data['storage_mtime'], $cacheData['storage_mtime']) && $data['storage_mtime'] === $cacheData['storage_mtime']) { $data['mtime'] = $cacheData['mtime']; if (($reuseExisting & self::REUSE_SIZE) && ($data['size'] === -1)) { $data['size'] = $cacheData['size']; diff --git a/lib/private/Files/Cache/Updater.php b/lib/private/Files/Cache/Updater.php index d3bc739ea30e..3fd246345574 100644 --- a/lib/private/Files/Cache/Updater.php +++ b/lib/private/Files/Cache/Updater.php @@ -123,7 +123,7 @@ public function update($path, $time = null) { $data = $this->scanner->scan($path, Scanner::SCAN_SHALLOW, -1, false); if ( - isset($data['oldSize']) && isset($data['size']) && + isset($data['oldSize'], $data['size']) && !$data['encrypted'] // encryption is a pita and touches the cache itself ) { $sizeDifference = $data['size'] - $data['oldSize']; diff --git a/lib/private/Files/Storage/DAV.php b/lib/private/Files/Storage/DAV.php index a8da3f941398..a18168adfeca 100644 --- a/lib/private/Files/Storage/DAV.php +++ b/lib/private/Files/Storage/DAV.php @@ -92,7 +92,7 @@ public function __construct($params) { $this->statCache = new ArrayCache(); $this->httpClientService = \OC::$server->getHTTPClientService(); $this->webDavClientService = \OC::$server->getWebDavClientService(); - if (isset($params['host']) && isset($params['user']) && isset($params['password'])) { + if (isset($params['host'], $params['user'], $params['password']) ) { $host = $params['host']; //remove leading http[s], will be generated in createBaseUri() if (\substr($host, 0, 8) == "https://") $host = \substr($host, 8); diff --git a/lib/private/Files/Storage/Wrapper/Encoding.php b/lib/private/Files/Storage/Wrapper/Encoding.php index 1502e594ae25..2dd51ebd493a 100644 --- a/lib/private/Files/Storage/Wrapper/Encoding.php +++ b/lib/private/Files/Storage/Wrapper/Encoding.php @@ -509,16 +509,16 @@ public function moveFromStorage(\OCP\Files\Storage $sourceStorage, $sourceIntern if ($sourceStorage === $this) { $result = $this->rename($sourceInternalPath, $this->findPathToUse($targetInternalPath)); if ($result) { - unset($this->namesCache[$sourceInternalPath]); - unset($this->namesCache[$targetInternalPath]); + unset($this->namesCache[$sourceInternalPath], $this->namesCache[$targetInternalPath]); + } return $result; } $result = $this->storage->moveFromStorage($sourceStorage, $sourceInternalPath, $this->findPathToUse($targetInternalPath)); if ($result) { - unset($this->namesCache[$sourceInternalPath]); - unset($this->namesCache[$targetInternalPath]); + unset($this->namesCache[$sourceInternalPath], $this->namesCache[$targetInternalPath]); + } return $result; } diff --git a/lib/private/Files/Type/Detection.php b/lib/private/Files/Type/Detection.php index e667238b6168..b3674c60a181 100644 --- a/lib/private/Files/Type/Detection.php +++ b/lib/private/Files/Type/Detection.php @@ -173,7 +173,7 @@ public function detectPath($path) { //try to guess the type by the file extension $extension = \strtolower(\strrchr($fileName, '.')); $extension = \substr($extension, 1); //remove leading . - return (isset($this->mimetypes[$extension]) && isset($this->mimetypes[$extension][0])) + return (isset($this->mimetypes[$extension], $this->mimetypes[$extension][0]) ) ? $this->mimetypes[$extension][0] : 'application/octet-stream'; } else { diff --git a/lib/private/NaturalSort.php b/lib/private/NaturalSort.php index e91e98d8f262..287edabbe9fd 100644 --- a/lib/private/NaturalSort.php +++ b/lib/private/NaturalSort.php @@ -110,7 +110,7 @@ public function compare($a, $b) { $aa = self::naturalSortChunkify($a); $bb = self::naturalSortChunkify($b); - for ($x = 0; isset($aa[$x]) && isset($bb[$x]); $x++) { + for ($x = 0; isset($aa[$x], $bb[$x]) ; $x++) { $aChunk = $aa[$x]; $bChunk = $bb[$x]; if ($aChunk !== $bChunk) { diff --git a/lib/private/Server.php b/lib/private/Server.php index 4280fb2798cc..b53a7ad95916 100644 --- a/lib/private/Server.php +++ b/lib/private/Server.php @@ -684,7 +684,7 @@ public function __construct($webRoot, \OC\Config $config) { 'server' => $_SERVER, 'env' => $_ENV, 'cookies' => $_COOKIE, - 'method' => (isset($_SERVER) && isset($_SERVER['REQUEST_METHOD'])) + 'method' => (isset($_SERVER, $_SERVER['REQUEST_METHOD']) ) ? $_SERVER['REQUEST_METHOD'] : null, 'urlParams' => $urlParams, @@ -764,7 +764,7 @@ public function __construct($webRoot, \OC\Config $config) { 'server' => $_SERVER, 'env' => $_ENV, 'cookies' => $_COOKIE, - 'method' => (isset($_SERVER) && isset($_SERVER['REQUEST_METHOD'])) + 'method' => (isset($_SERVER, $_SERVER['REQUEST_METHOD']) ) ? $_SERVER['REQUEST_METHOD'] : null, ], diff --git a/lib/private/Share/Share.php b/lib/private/Share/Share.php index 7f7804e15c4a..de71979a2bec 100644 --- a/lib/private/Share/Share.php +++ b/lib/private/Share/Share.php @@ -1898,7 +1898,7 @@ public static function getItems($itemType, $item = null, $shareType = null, $sha } } // Remove root from file source paths if retrieving own shared items - if (isset($uidOwner) && isset($row['path'])) { + if (isset($uidOwner, $row['path']) ) { if (isset($row['parent'])) { $query = \OC_DB::prepare('SELECT `file_target` FROM `*PREFIX*share` WHERE `id` = ?'); $parentResult = $query->execute([$row['parent']]); diff --git a/lib/private/User/Session.php b/lib/private/User/Session.php index e20297fddf1b..bc674b4d7288 100644 --- a/lib/private/User/Session.php +++ b/lib/private/User/Session.php @@ -968,9 +968,9 @@ public function unsetMagicInCookie() { //TODO: DI for cookies and IRequest $secureCookie = OC::$server->getRequest()->getServerProtocol() === 'https'; - unset($_COOKIE['oc_username']); //TODO: DI - unset($_COOKIE['oc_token']); - unset($_COOKIE['oc_remember_login']); + unset($_COOKIE['oc_username'], $_COOKIE['oc_token'], $_COOKIE['oc_remember_login']); //TODO: DI + + \setcookie('oc_username', '', \time() - 3600, OC::$WEBROOT, '', $secureCookie, true); \setcookie('oc_token', '', \time() - 3600, OC::$WEBROOT, '', $secureCookie, true); \setcookie('oc_remember_login', '', \time() - 3600, OC::$WEBROOT, '', $secureCookie, true); diff --git a/lib/private/legacy/app.php b/lib/private/legacy/app.php index b9800b5b4e2b..bc5ef6ba2d06 100644 --- a/lib/private/legacy/app.php +++ b/lib/private/legacy/app.php @@ -1181,7 +1181,7 @@ protected static function checkAppDependencies($config, $l, $info) { * @param $appId */ public static function clearAppCache($appId) { - unset(self::$appVersion[$appId]); - unset(self::$appInfo[$appId]); + unset(self::$appVersion[$appId], self::$appInfo[$appId]); + } } From e5b7d41308a4d51d32b67cd6cdc363784c6bf1d8 Mon Sep 17 00:00:00 2001 From: Phil Davis Date: Thu, 26 Apr 2018 08:31:06 +0545 Subject: [PATCH 3/8] php-cs-fixer: add no_spaces_inside_parenthesis --- .php_cs | 1 + 1 file changed, 1 insertion(+) diff --git a/.php_cs b/.php_cs index 4a63c0d6612f..14247cb5269b 100644 --- a/.php_cs +++ b/.php_cs @@ -45,6 +45,7 @@ return PhpCsFixer\Config::create() 'array_syntax' => ['syntax' => 'short'], 'combine_consecutive_issets' => true, 'combine_consecutive_unsets' => true, + 'no_spaces_inside_parenthesis' => true, ]) ->setFinder($finder) ; \ No newline at end of file From 98da62e08fcb3a60dec3f437e37102422f7bdfd8 Mon Sep 17 00:00:00 2001 From: Phil Davis Date: Thu, 26 Apr 2018 08:35:37 +0545 Subject: [PATCH 4/8] Applying new php-cs-fixer rule: no_spaces_inside_parenthesis --- apps/comments/lib/Dav/CommentNode.php | 2 +- apps/comments/lib/Dav/CommentsPlugin.php | 2 +- apps/dav/appinfo/v1/caldav.php | 2 +- apps/dav/lib/CardDAV/AddressBookImpl.php | 2 +- apps/dav/lib/CardDAV/Converter.php | 4 +- apps/dav/lib/Connector/Sabre/File.php | 2 +- apps/dav/tests/unit/DAV/CopyPluginTest.php | 2 +- apps/files/download.php | 6 +-- apps/files/lib/Command/TransferOwnership.php | 2 +- apps/files/lib/Helper.php | 2 +- apps/files/templates/list.php | 4 +- apps/files/templates/simplelist.php | 4 +- apps/files/tests/Command/ScanTest.php | 2 +- apps/files_external/lib/Lib/Api.php | 2 +- apps/files_external/lib/Lib/Storage/SFTP.php | 2 +- apps/files_external/lib/Lib/Storage/SMB.php | 2 +- apps/files_external/templates/list.php | 6 +-- .../tests/Storage/OwncloudTest.php | 2 +- .../tests/Storage/SFTP_KeyTest.php | 2 +- .../tests/Storage/WebdavTest.php | 2 +- apps/files_sharing/ajax/external.php | 2 +- .../lib/Controllers/ShareController.php | 4 +- apps/files_sharing/lib/External/Storage.php | 2 +- apps/files_sharing/lib/Helper.php | 6 +-- apps/files_sharing/templates/list.php | 6 +-- apps/files_sharing/tests/CacheTest.php | 2 +- apps/files_trashbin/ajax/delete.php | 4 +- apps/files_trashbin/ajax/undelete.php | 6 +-- apps/files_trashbin/lib/Hooks.php | 2 +- apps/files_trashbin/templates/index.php | 4 +- apps/files_versions/lib/Hooks.php | 2 +- apps/files_versions/lib/Storage.php | 2 +- apps/provisioning_api/lib/Users.php | 2 +- apps/systemtags/templates/list.php | 4 +- .../lib/Controller/AdminController.php | 4 +- core/Command/Background/Base.php | 2 +- core/Command/Maintenance/DataFingerprint.php | 2 +- core/Command/Security/ListRoutes.php | 4 +- core/Command/User/Modify.php | 2 +- core/Controller/SetupController.php | 4 +- core/Migrations/Version20170928120000.php | 2 +- core/ajax/share.php | 2 +- core/templates/403.php | 4 +- core/templates/404.php | 2 +- core/templates/altmail.php | 2 +- core/templates/installation.php | 46 +++++++++---------- core/templates/internalaltmail.php | 2 +- core/templates/internalmail.php | 2 +- core/templates/layout.guest.php | 2 +- core/templates/layout.user.php | 4 +- core/templates/mail.php | 2 +- core/templates/update.admin.php | 2 +- lib/base.php | 2 +- lib/private/AppConfig.php | 2 +- lib/private/Comments/Comment.php | 2 +- lib/private/Comments/Manager.php | 2 +- lib/private/DB/AdapterPgSql.php | 4 +- lib/private/DB/AdapterSqlite.php | 6 +-- lib/private/DB/Connection.php | 4 +- lib/private/DB/MDB2SchemaReader.php | 2 +- .../MySqlSchemaColumnDefinitionListener.php | 4 +- lib/private/Encryption/Util.php | 2 +- .../ObjectStore/HomeObjectStoreStorage.php | 2 +- lib/private/Files/Storage/DAV.php | 2 +- lib/private/Files/Stream/Checksum.php | 2 +- lib/private/Files/Type/Detection.php | 2 +- lib/private/Group/Database.php | 16 +++---- lib/private/Installer.php | 18 ++++---- lib/private/L10N/Factory.php | 2 +- lib/private/Log/Owncloud.php | 2 +- lib/private/Repair/SharePropagation.php | 2 +- lib/private/Search.php | 4 +- lib/private/Server.php | 4 +- lib/private/Setup/OCI.php | 2 +- lib/private/Share/Share.php | 14 +++--- lib/private/Tags.php | 6 +-- lib/private/Template/Base.php | 8 ++-- lib/private/Template/CSSResourceLocator.php | 2 +- lib/private/Template/JSResourceLocator.php | 2 +- lib/private/Template/ResourceLocator.php | 4 +- lib/private/Template/TemplateFileLocator.php | 4 +- lib/private/TemplateLayout.php | 24 +++++----- lib/private/URLGenerator.php | 6 +-- lib/private/User/Backend.php | 4 +- lib/private/User/Manager.php | 2 +- lib/private/User/RemoteUser.php | 2 +- lib/private/User/Session.php | 2 +- lib/private/User/User.php | 2 +- lib/private/legacy/db.php | 14 +++--- lib/private/legacy/hook.php | 14 +++--- lib/private/legacy/json.php | 10 ++-- lib/private/legacy/response.php | 8 ++-- lib/private/legacy/template.php | 40 ++++++++-------- lib/private/legacy/template/functions.php | 18 ++++---- lib/private/legacy/util.php | 6 +-- lib/public/App.php | 24 +++++----- lib/public/AppFramework/Db/Entity.php | 2 +- lib/public/AppFramework/Db/Mapper.php | 2 +- lib/public/BackgroundJob.php | 2 +- lib/public/Config.php | 28 +++++------ lib/public/DB.php | 2 +- lib/public/Files.php | 24 +++++----- lib/public/JSON.php | 12 ++--- lib/public/Response.php | 28 +++++------ lib/public/Template.php | 22 ++++----- lib/public/User.php | 20 ++++---- lib/public/Util.php | 38 +++++++-------- remote.php | 2 +- settings/Panels/Personal/Profile.php | 4 +- settings/ajax/setlanguage.php | 4 +- settings/help.php | 20 ++++---- .../templates/panels/admin/filesharing.php | 4 +- settings/templates/panels/admin/logging.php | 10 ++-- settings/templates/panels/admin/mail.php | 18 ++++---- .../panels/admin/securitywarning.php | 2 +- .../features/bootstrap/BasicStructure.php | 4 +- .../features/bootstrap/Provisioning.php | 2 +- tests/acceptance/features/bootstrap/Tags.php | 2 +- .../features/bootstrap/Trashbin.php | 4 +- .../acceptance/features/bootstrap/WebDav.php | 2 +- tests/lib/App/DependencyAnalyzerTest.php | 14 +++--- tests/lib/AvatarTest.php | 2 +- tests/lib/ContactsManagerTest.php | 2 +- tests/lib/DB/DBSchemaTest.php | 12 ++--- tests/lib/DB/LegacyDBTest.php | 6 +-- tests/lib/DB/SchemaDiffTest.php | 2 +- tests/lib/TestCase.php | 2 +- tests/lib/User/SessionTest.php | 4 +- tests/lib/User/Sync/AllUsersIteratorTest.php | 6 +-- tests/lib/User/Sync/SeenUsersIteratorTest.php | 6 +-- tests/lib/User/UserTest.php | 2 +- 131 files changed, 406 insertions(+), 406 deletions(-) diff --git a/apps/comments/lib/Dav/CommentNode.php b/apps/comments/lib/Dav/CommentNode.php index e1c955b1f948..697224b41692 100644 --- a/apps/comments/lib/Dav/CommentNode.php +++ b/apps/comments/lib/Dav/CommentNode.php @@ -118,7 +118,7 @@ static public function getPropertyNames() { 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/comments/lib/Dav/CommentsPlugin.php b/apps/comments/lib/Dav/CommentsPlugin.php index b95e73bd20f3..7639662c8511 100644 --- a/apps/comments/lib/Dav/CommentsPlugin.php +++ b/apps/comments/lib/Dav/CommentsPlugin.php @@ -187,7 +187,7 @@ public function onReport($reportName, $report, $uri) { foreach($results as $node) { $nodePath = $this->server->getRequestUri() . '/' . $node->comment->getId(); $resultSet = $this->server->getPropertiesForPath($nodePath, CommentNode::getPropertyNames()); - if(isset($resultSet[0], $resultSet[0][200]) ) { + if(isset($resultSet[0], $resultSet[0][200])) { $responses[] = new Response( $this->server->getBaseUri() . $nodePath, [200 => $resultSet[0][200]], diff --git a/apps/dav/appinfo/v1/caldav.php b/apps/dav/appinfo/v1/caldav.php index df9858f32518..1e3ebe637fc0 100644 --- a/apps/dav/appinfo/v1/caldav.php +++ b/apps/dav/appinfo/v1/caldav.php @@ -82,7 +82,7 @@ $server->addPlugin(new \Sabre\DAV\Sync\Plugin()); $server->addPlugin(new \Sabre\CalDAV\ICSExportPlugin()); $server->addPlugin(new \OCA\DAV\CalDAV\Schedule\Plugin()); -$server->addPlugin(new OCA\DAV\CalDAV\Schedule\IMipPlugin( \OC::$server->getMailer(), \OC::$server->getLogger(), \OC::$server->getRequest())); +$server->addPlugin(new OCA\DAV\CalDAV\Schedule\IMipPlugin(\OC::$server->getMailer(), \OC::$server->getLogger(), \OC::$server->getRequest())); $server->addPlugin(new ExceptionLoggerPlugin('caldav', \OC::$server->getLogger())); // And off we go! diff --git a/apps/dav/lib/CardDAV/AddressBookImpl.php b/apps/dav/lib/CardDAV/AddressBookImpl.php index aabe1a234d75..fee950a35ed1 100644 --- a/apps/dav/lib/CardDAV/AddressBookImpl.php +++ b/apps/dav/lib/CardDAV/AddressBookImpl.php @@ -241,7 +241,7 @@ protected function vCard2Array($uri, VCard $vCard) { $result[$property->name] = $property->getValue(); } } - if ($this->addressBookInfo['principaluri'] === 'principals/system/system' ) { + if ($this->addressBookInfo['principaluri'] === 'principals/system/system') { $result['isSystemBook'] = true; if ($this->addressBookInfo['uri'] === 'system') { $result['isLocalSystemBook'] = true; diff --git a/apps/dav/lib/CardDAV/Converter.php b/apps/dav/lib/CardDAV/Converter.php index a7596e5868a0..59a10ed9229a 100644 --- a/apps/dav/lib/CardDAV/Converter.php +++ b/apps/dav/lib/CardDAV/Converter.php @@ -37,7 +37,7 @@ public function createCardFromUser(IUser $user) { $uid = $user->getUID(); $displayName = $user->getDisplayName(); - $displayName = empty($displayName ) ? $uid : $displayName; + $displayName = empty($displayName) ? $uid : $displayName; $emailAddress = $user->getEMailAddress(); $cloudId = $user->getCloudId(); $image = $this->getAvatarImage($user); @@ -71,7 +71,7 @@ public function createCardFromUser(IUser $user) { public function updateCard(VCard $vCard, IUser $user) { $uid = $user->getUID(); $displayName = $user->getDisplayName(); - $displayName = empty($displayName ) ? $uid : $displayName; + $displayName = empty($displayName) ? $uid : $displayName; $emailAddress = $user->getEMailAddress(); $cloudId = $user->getCloudId(); $image = $this->getAvatarImage($user); diff --git a/apps/dav/lib/Connector/Sabre/File.php b/apps/dav/lib/Connector/Sabre/File.php index 4af9c8e15d90..6383dd82b6d5 100644 --- a/apps/dav/lib/Connector/Sabre/File.php +++ b/apps/dav/lib/Connector/Sabre/File.php @@ -548,7 +548,7 @@ private function createFileChunked($data) { $info = $this->fileView->getFileInfo($targetPath); - if (isset($partStorage, $partInternalPath) ) { + if (isset($partStorage, $partInternalPath)) { $checksums = $partStorage->getMetaData($partInternalPath)['checksum']; } else { $checksums = $targetStorage->getMetaData($targetInternalPath)['checksum']; diff --git a/apps/dav/tests/unit/DAV/CopyPluginTest.php b/apps/dav/tests/unit/DAV/CopyPluginTest.php index 121ef9f4dbb2..66bb9f8d5962 100644 --- a/apps/dav/tests/unit/DAV/CopyPluginTest.php +++ b/apps/dav/tests/unit/DAV/CopyPluginTest.php @@ -57,7 +57,7 @@ public function setUp() { /** @var RequestInterface | \PHPUnit_Framework_MockObject_MockObject $request */ $this->request = $this->createMock(RequestInterface::class); /** @var ResponseInterface | \PHPUnit_Framework_MockObject_MockObject $response */ - $this->response = $this->createMock( ResponseInterface::class); + $this->response = $this->createMock(ResponseInterface::class); $this->plugin->initialize($this->server); } diff --git a/apps/files/download.php b/apps/files/download.php index 76114f1199e7..ca38a319a230 100644 --- a/apps/files/download.php +++ b/apps/files/download.php @@ -33,13 +33,13 @@ if(!\OC\Files\Filesystem::file_exists($filename)) { \header("HTTP/1.0 404 Not Found"); - $tmpl = new OCP\Template( '', '404', 'guest' ); + $tmpl = new OCP\Template('', '404', 'guest'); $tmpl->assign('file', $filename); $tmpl->printPage(); exit; } -$ftype=\OC::$server->getMimeTypeDetector()->getSecureMimeType(\OC\Files\Filesystem::getMimeType( $filename )); +$ftype=\OC::$server->getMimeTypeDetector()->getSecureMimeType(\OC\Files\Filesystem::getMimeType($filename)); \header('Content-Type:'.$ftype); OCP\Response::setContentDispositionHeader(\basename($filename), 'attachment'); @@ -47,4 +47,4 @@ OCP\Response::setContentLengthHeader(\OC\Files\Filesystem::filesize($filename)); OC_Util::obEnd(); -\OC\Files\Filesystem::readfile( $filename ); +\OC\Files\Filesystem::readfile($filename); diff --git a/apps/files/lib/Command/TransferOwnership.php b/apps/files/lib/Command/TransferOwnership.php index e2b3093d3dd3..389ae784c0c4 100644 --- a/apps/files/lib/Command/TransferOwnership.php +++ b/apps/files/lib/Command/TransferOwnership.php @@ -193,7 +193,7 @@ protected function analyse(OutputInterface $output) { $progress->start(); $self = $this; $walkPath = "$this->sourceUser/files"; - if ( \strlen($this->inputPath) > 0) { + if (\strlen($this->inputPath) > 0) { if ($this->inputPath !== "$this->sourceUser/files") { $walkPath = $this->inputPath; $this->foldersExist = true; diff --git a/apps/files/lib/Helper.php b/apps/files/lib/Helper.php index 602d50f21782..aa0b9d0da64b 100644 --- a/apps/files/lib/Helper.php +++ b/apps/files/lib/Helper.php @@ -230,7 +230,7 @@ public static function populateTags(array $fileList, $fileIdentifier = 'fileid') foreach ($filesById as $key => $fileWithTags) { foreach($fileList as $key2 => $file){ - if( $file[$fileIdentifier] == $key){ + if($file[$fileIdentifier] == $key){ $fileList[$key2] = $fileWithTags; } } diff --git a/apps/files/templates/list.php b/apps/files/templates/list.php index 989a3e6afbe4..d9b095cb6db8 100644 --- a/apps/files/templates/list.php +++ b/apps/files/templates/list.php @@ -44,7 +44,7 @@ - t( 'Name' )); ?> + t('Name')); ?> @@ -57,7 +57,7 @@ t('Size')); ?> - t( 'Modified' )); ?> + t('Modified')); ?> t('Delete'))?> diff --git a/apps/files/templates/simplelist.php b/apps/files/templates/simplelist.php index ca26d9b5d5b3..ca3991420cf2 100644 --- a/apps/files/templates/simplelist.php +++ b/apps/files/templates/simplelist.php @@ -19,14 +19,14 @@ t('Size')); ?> - t( 'Modified' )); ?> + t('Modified')); ?> t('Delete'))?> <?php p($l->t('Delete'))?>createUser($user.$i); } diff --git a/apps/files_external/lib/Lib/Api.php b/apps/files_external/lib/Lib/Api.php index ab35ad8744a6..dc3b7a81cdbe 100644 --- a/apps/files_external/lib/Lib/Api.php +++ b/apps/files_external/lib/Lib/Api.php @@ -60,7 +60,7 @@ private static function formatMount($mountPoint, $mountConfig) { 'path' => $path, 'type' => 'dir', 'backend' => $mountConfig['backend'], - 'scope' => ( $isSystemMount ? 'system' : 'personal' ), + 'scope' => ($isSystemMount ? 'system' : 'personal'), 'permissions' => $permissions, 'id' => $mountConfig['id'], 'class' => $mountConfig['class'] diff --git a/apps/files_external/lib/Lib/Storage/SFTP.php b/apps/files_external/lib/Lib/Storage/SFTP.php index 777bc01207d1..9818d5019863 100644 --- a/apps/files_external/lib/Lib/Storage/SFTP.php +++ b/apps/files_external/lib/Lib/Storage/SFTP.php @@ -360,7 +360,7 @@ public function fopen($path, $mode) { switch($mode) { case 'r': case 'rb': - if ( !$this->file_exists($path)) { + if (!$this->file_exists($path)) { return false; } case 'w': diff --git a/apps/files_external/lib/Lib/Storage/SMB.php b/apps/files_external/lib/Lib/Storage/SMB.php index 539d600314b1..edc965f88d61 100644 --- a/apps/files_external/lib/Lib/Storage/SMB.php +++ b/apps/files_external/lib/Lib/Storage/SMB.php @@ -76,7 +76,7 @@ public function __construct($params) { } $this->log('enter: '.__FUNCTION__.'('.\json_encode($loggedParams).')'); - if (isset($params['host'], $params['user'], $params['password'], $params['share']) ) { + if (isset($params['host'], $params['user'], $params['password'], $params['share'])) { if (Server::NativeAvailable()) { $this->log('using native libsmbclient'); $this->server = new NativeServer($params['host'], $params['user'], $params['password']); diff --git a/apps/files_external/templates/list.php b/apps/files_external/templates/list.php index 7a33191054f2..3da7ca7887d8 100644 --- a/apps/files_external/templates/list.php +++ b/apps/files_external/templates/list.php @@ -10,7 +10,7 @@ $userId = \OC::$server->getUserSession()->getUser()->getUID(); if (\OC::$server->getGroupManager()->isAdmin($userId)) { echo '

' . $l->t('You can add external storages in the storage settings') . '

'; @@ -18,7 +18,7 @@ else { echo '

' . $l->t('You can add external storages in the storage settings') . '

'; @@ -33,7 +33,7 @@ diff --git a/apps/files_external/tests/Storage/OwncloudTest.php b/apps/files_external/tests/Storage/OwncloudTest.php index 23ae848cef7e..4496e4de003d 100644 --- a/apps/files_external/tests/Storage/OwncloudTest.php +++ b/apps/files_external/tests/Storage/OwncloudTest.php @@ -43,7 +43,7 @@ protected function setUp() { $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('ownCloud 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 a19a1db8aebc..6a7a0f9c896b 100644 --- a/apps/files_external/tests/Storage/SFTP_KeyTest.php +++ b/apps/files_external/tests/Storage/SFTP_KeyTest.php @@ -42,7 +42,7 @@ protected function setUp() { $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_external/tests/Storage/WebdavTest.php b/apps/files_external/tests/Storage/WebdavTest.php index acfbc43ad733..36a69451013d 100644 --- a/apps/files_external/tests/Storage/WebdavTest.php +++ b/apps/files_external/tests/Storage/WebdavTest.php @@ -42,7 +42,7 @@ protected function setUp() { $id = $this->getUniqueID(); $config = include('files_external/tests/config.webdav.php'); - if ( ! \is_array($config) or !$config['run']) { + if (! \is_array($config) or !$config['run']) { $this->markTestSkipped('WebDAV backend not configured'); } if (isset($config['wait'])) { diff --git a/apps/files_sharing/ajax/external.php b/apps/files_sharing/ajax/external.php index 333c00636df9..fd9ae36e6d4c 100644 --- a/apps/files_sharing/ajax/external.php +++ b/apps/files_sharing/ajax/external.php @@ -56,7 +56,7 @@ $currentUser = \OC::$server->getUserSession()->getUser()->getUID(); $currentServer = \OC::$server->getURLGenerator()->getAbsoluteURL('/'); -if (\OC\Share\Helper::isSameUserOnSameServer($owner, $remote, $currentUser, $currentServer )) { +if (\OC\Share\Helper::isSameUserOnSameServer($owner, $remote, $currentUser, $currentServer)) { \OCP\JSON::error(['data' => ['message' => $l->t('Not allowed to create a federated share with the same user server')]]); exit(); } diff --git a/apps/files_sharing/lib/Controllers/ShareController.php b/apps/files_sharing/lib/Controllers/ShareController.php index 992c3693f892..fd3c4c8bd247 100644 --- a/apps/files_sharing/lib/Controllers/ShareController.php +++ b/apps/files_sharing/lib/Controllers/ShareController.php @@ -182,7 +182,7 @@ private function linkShareAuth(\OCP\Share\IShare $share, $password = null) { } } else { // not authenticated ? - if ( ! $this->session->exists('public_link_authenticated') + if (! $this->session->exists('public_link_authenticated') || $this->session->get('public_link_authenticated') !== (string)$share->getId()) { return false; } @@ -348,7 +348,7 @@ public function showShare($token, $path = '') { $shareTmpl['previewMaxX'] = $this->config->getSystemValue('preview_max_x', 1024); $shareTmpl['previewMaxY'] = $this->config->getSystemValue('preview_max_y', 1024); if ($shareTmpl['previewSupported']) { - $shareTmpl['previewImage'] = $this->urlGenerator->linkToRouteAbsolute( 'core_ajax_public_preview', + $shareTmpl['previewImage'] = $this->urlGenerator->linkToRouteAbsolute('core_ajax_public_preview', ['x' => 200, 'y' => 200, 'file' => $shareTmpl['directory_path'], 't' => $shareTmpl['dirToken']]); } else { $shareTmpl['previewImage'] = $this->urlGenerator->getAbsoluteURL($this->urlGenerator->imagePath('core', 'favicon-fb.png')); diff --git a/apps/files_sharing/lib/External/Storage.php b/apps/files_sharing/lib/External/Storage.php index ff5eb0e9b164..1bdd4d19f236 100644 --- a/apps/files_sharing/lib/External/Storage.php +++ b/apps/files_sharing/lib/External/Storage.php @@ -213,7 +213,7 @@ public function test() { public function checkStorageAvailability() { // see if we can find out why the share is unavailable try { - if ( ! $this->propfind('') ) { + if (! $this->propfind('')) { // a 404 can either mean that the share no longer exists or there is no ownCloud on the remote if ($this->testRemote()) { // valid ownCloud instance means that the public share no longer exists diff --git a/apps/files_sharing/lib/Helper.php b/apps/files_sharing/lib/Helper.php index 54a8b4feb6fb..7bb1af491950 100644 --- a/apps/files_sharing/lib/Helper.php +++ b/apps/files_sharing/lib/Helper.php @@ -156,7 +156,7 @@ public static function authenticate($linkItem, $password = null) { } else { // not authenticated ? - if ( ! \OC::$server->getSession()->exists('public_link_authenticated') + if (! \OC::$server->getSession()->exists('public_link_authenticated') || \OC::$server->getSession()->get('public_link_authenticated') !== (string)$linkItem['id']) { return false; } @@ -170,7 +170,7 @@ public static function getSharesFromItem($target) { Filesystem::initMountPoints($owner); $info = Filesystem::getFileInfo($target); $ownerView = new View('/'.$owner.'/files'); - if ( $owner != User::getUser() ) { + if ($owner != User::getUser()) { $path = $ownerView->getPath($info['fileid']); } else { $path = $target; @@ -221,7 +221,7 @@ public static function getUidAndFilename($filename) { $uid = User::getUser(); } Filesystem::initMountPoints($uid); - if ( $uid != User::getUser() ) { + if ($uid != User::getUser()) { $info = Filesystem::getFileInfo($filename); $ownerView = new View('/'.$uid.'/files'); try { diff --git a/apps/files_sharing/templates/list.php b/apps/files_sharing/templates/list.php index 696beae06d00..95f2be437a8d 100644 --- a/apps/files_sharing/templates/list.php +++ b/apps/files_sharing/templates/list.php @@ -16,14 +16,14 @@ - t( 'Share time' )); ?> + t('Share time')); ?> - t( 'Expiration date' )); ?> + t('Expiration date')); ?> diff --git a/apps/files_sharing/tests/CacheTest.php b/apps/files_sharing/tests/CacheTest.php index 3f529d5140b7..dd49d32b6fe5 100644 --- a/apps/files_sharing/tests/CacheTest.php +++ b/apps/files_sharing/tests/CacheTest.php @@ -442,7 +442,7 @@ function testGetFolderContentsWhenSubSubdirShared() { */ private function verifyFiles($examples, $results) { $this->assertCount(\count($examples), $results, - 'Files found: ' . \implode(', ', \array_map(function( $f) { + 'Files found: ' . \implode(', ', \array_map(function($f) { /** @var FileInfo | ICacheEntry $f */ return $f->getPath(); }, $results))); diff --git a/apps/files_trashbin/ajax/delete.php b/apps/files_trashbin/ajax/delete.php index 797ed7193b44..6943a3fbab55 100644 --- a/apps/files_trashbin/ajax/delete.php +++ b/apps/files_trashbin/ajax/delete.php @@ -76,9 +76,9 @@ } } -if ( $error ) { +if ($error) { $filelist = ''; - foreach ( $error as $e ) { + foreach ($error as $e) { $filelist .= $e.', '; } $l = \OC::$server->getL10N('files_trashbin'); diff --git a/apps/files_trashbin/ajax/undelete.php b/apps/files_trashbin/ajax/undelete.php index 42731ff1498b..7ea6c273d24d 100644 --- a/apps/files_trashbin/ajax/undelete.php +++ b/apps/files_trashbin/ajax/undelete.php @@ -71,7 +71,7 @@ $timestamp = null; } - if ( !OCA\Files_Trashbin\Trashbin::restore($path, $filename, $timestamp) ) { + if (!OCA\Files_Trashbin\Trashbin::restore($path, $filename, $timestamp)) { $error[] = $filename; \OCP\Util::writeLog('trashbin', 'can\'t restore ' . $filename, \OCP\Util::DEBUG); } else { @@ -82,9 +82,9 @@ } -if ( $error ) { +if ($error) { $filelist = ''; - foreach ( $error as $e ) { + foreach ($error as $e) { $filelist .= $e.', '; } $l = OC::$server->getL10N('files_trashbin'); diff --git a/apps/files_trashbin/lib/Hooks.php b/apps/files_trashbin/lib/Hooks.php index 236ea7d1aa91..05a63c30362e 100644 --- a/apps/files_trashbin/lib/Hooks.php +++ b/apps/files_trashbin/lib/Hooks.php @@ -38,7 +38,7 @@ class Hooks { * to remove the used space for the trash bin stored in the database */ public static function deleteUser_hook($params) { - if( \OCP\App::isEnabled('files_trashbin') ) { + if(\OCP\App::isEnabled('files_trashbin')) { $uid = $params['uid']; Trashbin::deleteUser($uid); } diff --git a/apps/files_trashbin/templates/index.php b/apps/files_trashbin/templates/index.php index c204c3f8ab96..7b396406f13e 100644 --- a/apps/files_trashbin/templates/index.php +++ b/apps/files_trashbin/templates/index.php @@ -25,7 +25,7 @@ - t( 'Name' )); ?> + t('Name')); ?> @@ -35,7 +35,7 @@ - t( 'Deleted' )); ?> + t('Deleted')); ?> t('Delete'))?> diff --git a/apps/files_versions/lib/Hooks.php b/apps/files_versions/lib/Hooks.php index 78838b7d5c06..4779e2c55cb0 100644 --- a/apps/files_versions/lib/Hooks.php +++ b/apps/files_versions/lib/Hooks.php @@ -52,7 +52,7 @@ public static function connectHooks() { /** * listen to write event. */ - public static function write_hook( $params ) { + public static function write_hook($params) { if (\OCP\App::isEnabled('files_versions')) { $path = $params[\OC\Files\Filesystem::signal_param_path]; diff --git a/apps/files_versions/lib/Storage.php b/apps/files_versions/lib/Storage.php index 1e2e514f8544..35e63d4a1476 100644 --- a/apps/files_versions/lib/Storage.php +++ b/apps/files_versions/lib/Storage.php @@ -101,7 +101,7 @@ public static function getUidAndFilename($filename) { $uid = User::getUser(); } Filesystem::initMountPoints($uid); - if ( $uid != User::getUser() ) { + if ($uid != User::getUser()) { $info = Filesystem::getFileInfo($filename); $ownerView = new View('/'.$uid.'/files'); try { diff --git a/apps/provisioning_api/lib/Users.php b/apps/provisioning_api/lib/Users.php index 119b256b2700..bdcd8ac9ef91 100644 --- a/apps/provisioning_api/lib/Users.php +++ b/apps/provisioning_api/lib/Users.php @@ -65,7 +65,7 @@ public function __construct(IUserManager $userManager, IGroupManager $groupManager, IUserSession $userSession, ILogger $logger, - \OC\Authentication\TwoFactorAuth\Manager $twoFactorAuthManager ) { + \OC\Authentication\TwoFactorAuth\Manager $twoFactorAuthManager) { $this->userManager = $userManager; $this->groupManager = $groupManager; $this->userSession = $userSession; diff --git a/apps/systemtags/templates/list.php b/apps/systemtags/templates/list.php index 841ce7b5b6dd..b2929034b65d 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/updatenotification/lib/Controller/AdminController.php b/apps/updatenotification/lib/Controller/AdminController.php index e5b4dd52fbfe..6060c67ba5ed 100644 --- a/apps/updatenotification/lib/Controller/AdminController.php +++ b/apps/updatenotification/lib/Controller/AdminController.php @@ -123,9 +123,9 @@ public function displayPanel() { $newVersionString = ($updateState === []) ? '' : $updateState['updateVersion']; $changeLogUrl = null; - if( $isNewVersionAvailable === true ){ + if($isNewVersionAvailable === true){ $varsionParts = \explode(' ', $newVersionString); - if( \count($varsionParts) >= 2){ + if(\count($varsionParts) >= 2){ $versionParts = \explode('.', $varsionParts[1]); // remove the 'ownCloud' prefix \array_splice($versionParts, 2); // remove minor version info from parts $changeLogUrl = 'https://owncloud.org/changelog/#latest' . \implode('.', $versionParts); diff --git a/core/Command/Background/Base.php b/core/Command/Background/Base.php index f17fc84906d4..6b8521e93eb9 100644 --- a/core/Command/Background/Base.php +++ b/core/Command/Background/Base.php @@ -71,7 +71,7 @@ protected function configure() { */ 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/Maintenance/DataFingerprint.php b/core/Command/Maintenance/DataFingerprint.php index d486ed8ecfb4..ccd1e9f4b243 100644 --- a/core/Command/Maintenance/DataFingerprint.php +++ b/core/Command/Maintenance/DataFingerprint.php @@ -43,7 +43,7 @@ class DataFingerprint extends Command { public function __construct(IConfig $config, ITimeFactory $timeFactory, - ILogger $logger ) { + ILogger $logger) { $this->config = $config; $this->timeFactory = $timeFactory; $this->logger = $logger; diff --git a/core/Command/Security/ListRoutes.php b/core/Command/Security/ListRoutes.php index 974162e7f936..921e2035c8e4 100644 --- a/core/Command/Security/ListRoutes.php +++ b/core/Command/Security/ListRoutes.php @@ -108,7 +108,7 @@ protected function execute(InputInterface $input, OutputInterface $output) { return $row; }, $rows); - if ($outputType === self::OUTPUT_FORMAT_JSON ) { + if ($outputType === self::OUTPUT_FORMAT_JSON) { $output->write(\json_encode($rows)); } else if ($outputType === self::OUTPUT_FORMAT_JSON_PRETTY) { $output->writeln(\json_encode($rows, JSON_PRETTY_PRINT)); @@ -202,7 +202,7 @@ private function listMethodNames($method) { yield $method; yield \implode('', \explode('_', $method)); foreach (['post', 'put'] as $verb) { - if (\substr( $method, -\strlen($verb)) == $verb) { + if (\substr($method, -\strlen($verb)) == $verb) { yield \substr($method, 0, -\strlen($verb)); yield \implode('', \explode('_', \substr($method, 0, -\strlen($verb)))); } diff --git a/core/Command/User/Modify.php b/core/Command/User/Modify.php index 31529de1142b..f5ae0bbbdee4 100644 --- a/core/Command/User/Modify.php +++ b/core/Command/User/Modify.php @@ -128,7 +128,7 @@ protected function execute(InputInterface $input, OutputInterface $output) { } if (($key === 'displayname') && ($value !== null) && ($value !== '')) { - if ($user->setDisplayName($value) === true ) { + if ($user->setDisplayName($value) === true) { $output->writeln('The displayname of ' . $uid . ' updated to ' . $value); return 0; } diff --git a/core/Controller/SetupController.php b/core/Controller/SetupController.php index 6dc43eec7c82..b40bfc3e8700 100644 --- a/core/Controller/SetupController.php +++ b/core/Controller/SetupController.php @@ -96,7 +96,7 @@ public function display($post) { } public function finishSetup() { - if( \file_exists( $this->autoConfigFile )) { + if(\file_exists($this->autoConfigFile)) { \unlink($this->autoConfigFile); } \OC::$server->getIntegrityCodeChecker()->runInstanceVerification(); @@ -104,7 +104,7 @@ public function finishSetup() { } public function loadAutoConfig($post) { - if( \file_exists($this->autoConfigFile)) { + if(\file_exists($this->autoConfigFile)) { \OCP\Util::writeLog('core', 'Autoconfig file found, setting up ownCloud…', \OCP\Util::INFO); $AUTOCONFIG = []; include $this->autoConfigFile; diff --git a/core/Migrations/Version20170928120000.php b/core/Migrations/Version20170928120000.php index 469359e75e4c..1ff32c1450ab 100644 --- a/core/Migrations/Version20170928120000.php +++ b/core/Migrations/Version20170928120000.php @@ -13,7 +13,7 @@ class Version20170928120000 implements ISchemaMigration { public function changeSchema(Schema $schema, array $options) { $prefix = $options['tablePrefix']; $table = $schema->getTable("${prefix}filecache"); - foreach ( ['mtime','storage_mtime'] as $column ) { + foreach (['mtime','storage_mtime'] as $column) { if ($table->getColumn($column)->getType()->getName() === Type::INTEGER) { $table->getColumn($column)->setType(Type::getType(Type::BIGINT)); } diff --git a/core/ajax/share.php b/core/ajax/share.php index c83a34805e95..a6494835190a 100644 --- a/core/ajax/share.php +++ b/core/ajax/share.php @@ -98,7 +98,7 @@ function usersInGroup($gid, $search = '', $limit = -1, $offset = 0) { } } -if (isset($_POST['action'], $_POST['itemType'], $_POST['itemSource']) ) { +if (isset($_POST['action'], $_POST['itemType'], $_POST['itemSource'])) { switch ($_POST['action']) { case 'informRecipients': $l = \OC::$server->getL10N('core'); diff --git a/core/templates/403.php b/core/templates/403.php index 7d07c72c873a..538dbf6387c1 100644 --- a/core/templates/403.php +++ b/core/templates/403.php @@ -3,7 +3,7 @@ if(!isset($_)) {//also provide standalone error page require_once '../../lib/base.php'; - $tmpl = new OC_Template( '', '403', 'guest' ); + $tmpl = new OC_Template('', '403', 'guest'); $tmpl->printPage(); exit; } @@ -11,7 +11,7 @@ ?>
  • - t( 'Access forbidden' )); ?>
    + t('Access forbidden')); ?>

diff --git a/core/templates/404.php b/core/templates/404.php index cc3a60c3283c..598c49881d1d 100644 --- a/core/templates/404.php +++ b/core/templates/404.php @@ -6,7 +6,7 @@ if(!isset($_)) {//also provide standalone error page require_once '../../lib/base.php'; - $tmpl = new OC_Template( '', '404', 'guest' ); + $tmpl = new OC_Template('', '404', 'guest'); $tmpl->printPage(); exit; } diff --git a/core/templates/altmail.php b/core/templates/altmail.php index da60443c6a4c..b9b6ff83c39e 100644 --- a/core/templates/altmail.php +++ b/core/templates/altmail.php @@ -1,6 +1,6 @@ t("Hey there,\n\njust letting you know that %s shared %s with you.\nView it: %s\n\n", [$_['user_displayname'], $_['filename'], $_['link']])); -if ( isset($_['expiration']) ) { +if (isset($_['expiration'])) { print_unescaped($l->t("The share will expire on %s.", [$_['expiration']])); print_unescaped("\n\n"); } diff --git a/core/templates/installation.php b/core/templates/installation.php index 85eace46d33f..c3c96745ef75 100644 --- a/core/templates/installation.php +++ b/core/templates/installation.php @@ -26,20 +26,20 @@
- t( 'Create an admin account' )); ?> + t('Create an admin account')); ?>

- +

- +

@@ -47,14 +47,14 @@ 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.')); ?> ↗

@@ -91,25 +91,25 @@

- +

- +

- + @@ -117,23 +117,23 @@

- +

- +

- 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).')); ?>

@@ -151,7 +151,7 @@
-
+

diff --git a/core/templates/internalaltmail.php b/core/templates/internalaltmail.php index cf5285a868b6..f7cdb1d5b0f1 100644 --- a/core/templates/internalaltmail.php +++ b/core/templates/internalaltmail.php @@ -1,6 +1,6 @@ t("Hey there,\n\njust letting you know that %s shared %s with you.\nView it: %s\n\n", [$_['user_displayname'], $_['filename'], $_['link']])); -if ( isset($_['expiration']) ) { +if (isset($_['expiration'])) { print_unescaped($l->t("The share will expire on %s.", [$_['expiration']])); print_unescaped("\n\n"); } diff --git a/core/templates/internalmail.php b/core/templates/internalmail.php index b05eceebb805..141508b1c112 100644 --- a/core/templates/internalmail.php +++ b/core/templates/internalmail.php @@ -13,7 +13,7 @@ t('Hey there,

just letting you know that %s shared %s with you.
View it!

', [$_['user_displayname'], $_['filename'], $_['link']])); -if ( isset($_['expiration']) ) { +if (isset($_['expiration'])) { p($l->t("The share will expire on %s.", [$_['expiration']])); print_unescaped('

'); } diff --git a/core/templates/layout.guest.php b/core/templates/layout.guest.php index 585063531586..f41eb1b27f1d 100644 --- a/core/templates/layout.guest.php +++ b/core/templates/layout.guest.php @@ -28,7 +28,7 @@

- +
diff --git a/lib/base.php b/lib/base.php index ff5ade766a5b..45c35b7f8d92 100644 --- a/lib/base.php +++ b/lib/base.php @@ -190,7 +190,7 @@ public static function initPaths() { $config_paths = self::$config->getValue('apps_paths', []); if (!empty($config_paths)) { foreach ($config_paths as $paths) { - if (isset($paths['url'], $paths['path']) ) { + if (isset($paths['url'], $paths['path'])) { $paths['url'] = \rtrim($paths['url'], '/'); $paths['path'] = \rtrim($paths['path'], '/'); OC::$APPSROOTS[] = $paths; diff --git a/lib/private/AppConfig.php b/lib/private/AppConfig.php index cf0c6f86e6b1..796be5b3b078 100644 --- a/lib/private/AppConfig.php +++ b/lib/private/AppConfig.php @@ -191,7 +191,7 @@ public function setValue($app, $key, $value) { ->setParameter('configvalue', $value); } - if (isset($this->cache[$app], $this->cache[$app][$key]) ) { + if (isset($this->cache[$app], $this->cache[$app][$key])) { $afterArray['update'] = true; $afterArray['oldvalue'] = $this->cache[$app][$key]; } diff --git a/lib/private/Comments/Comment.php b/lib/private/Comments/Comment.php index d38f0bc08163..3678b74c0d8d 100644 --- a/lib/private/Comments/Comment.php +++ b/lib/private/Comments/Comment.php @@ -372,7 +372,7 @@ protected function fromArray($data) { } foreach(['actor', 'object'] as $role) { - if(isset($data[$role . '_type'], $data[$role.'_id']) ) { + if(isset($data[$role . '_type'], $data[$role.'_id'])) { $setter = 'set' . \ucfirst($role); $this->$setter($data[$role . '_type'], $data[$role . '_id']); } diff --git a/lib/private/Comments/Manager.php b/lib/private/Comments/Manager.php index f1a63edfa3fd..4b8cc6efa0ae 100644 --- a/lib/private/Comments/Manager.php +++ b/lib/private/Comments/Manager.php @@ -102,7 +102,7 @@ protected function normalizeDatabaseData(array $data) { * @throws \UnexpectedValueException */ protected function prepareCommentForDatabaseWrite(IComment $comment) { - if( !$comment->getActorType() + if(!$comment->getActorType() || !$comment->getActorId() || !$comment->getObjectType() || !$comment->getObjectId() diff --git a/lib/private/DB/AdapterPgSql.php b/lib/private/DB/AdapterPgSql.php index 562a0281c8b2..29ce5ff5163e 100644 --- a/lib/private/DB/AdapterPgSql.php +++ b/lib/private/DB/AdapterPgSql.php @@ -30,8 +30,8 @@ public function lastInsertId($table) { 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 adfa439905d7..530aca64ab08 100644 --- a/lib/private/DB/AdapterSqlite.php +++ b/lib/private/DB/AdapterSqlite.php @@ -42,10 +42,10 @@ public function unlockTable() { public function fixupStatement($statement) { $statement = \preg_replace('( I?LIKE \?)', '$0 ESCAPE \'\\\'', $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 ccc7efd5befb..189ff3580076 100644 --- a/lib/private/DB/Connection.php +++ b/lib/private/DB/Connection.php @@ -153,7 +153,7 @@ public function __construct(array $params, Driver $driver, Configuration $config * @param int $offset * @return \Doctrine\DBAL\Driver\Statement The prepared statement. */ - public function prepare( $statement, $limit=null, $offset=null ) { + public function prepare($statement, $limit=null, $offset=null) { if ($limit === -1) { $limit = null; } @@ -393,7 +393,7 @@ public function tableExists($table){ * @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/DB/MDB2SchemaReader.php b/lib/private/DB/MDB2SchemaReader.php index f32693d2b218..9f862f75268d 100644 --- a/lib/private/DB/MDB2SchemaReader.php +++ b/lib/private/DB/MDB2SchemaReader.php @@ -212,7 +212,7 @@ private function loadField($table, $xml) { } } - if (isset($name, $type) ) { + if (isset($name, $type)) { if (isset($options['default']) && empty($options['default'])) { if (empty($options['notnull']) || !$options['notnull']) { unset($options['default']); diff --git a/lib/private/DB/MySqlSchemaColumnDefinitionListener.php b/lib/private/DB/MySqlSchemaColumnDefinitionListener.php index 1d214e43193a..fb51af87ed56 100644 --- a/lib/private/DB/MySqlSchemaColumnDefinitionListener.php +++ b/lib/private/DB/MySqlSchemaColumnDefinitionListener.php @@ -110,7 +110,7 @@ protected function _getPortableTableColumnDefinition($tableColumn) $fixed = null; - if ( ! isset($tableColumn['name'])) { + if (! isset($tableColumn['name'])) { $tableColumn['name'] = ''; } @@ -240,7 +240,7 @@ private function getMariaDb1027ColumnDefault($columnDefault) */ private function getMariaDbMysqlVersionNumber($versionString) { - if ( !\preg_match('/^(?:5\.5\.5-)?(mariadb-)?(?P\d+)\.(?P\d+)\.(?P\d+)/i', $versionString, $versionParts)) { + if (!\preg_match('/^(?:5\.5\.5-)?(mariadb-)?(?P\d+)\.(?P\d+)\.(?P\d+)/i', $versionString, $versionParts)) { throw DBALException::invalidPlatformVersionSpecified( $versionString, '^(?:5\.5\.5-)?(mariadb-)?..' diff --git a/lib/private/Encryption/Util.php b/lib/private/Encryption/Util.php index 152c77c34e65..10d1bd3f06c0 100644 --- a/lib/private/Encryption/Util.php +++ b/lib/private/Encryption/Util.php @@ -254,7 +254,7 @@ public function getUidAndFilename($path) { 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 835a3a69d368..dd091fe7dd93 100644 --- a/lib/private/Files/ObjectStore/HomeObjectStoreStorage.php +++ b/lib/private/Files/ObjectStore/HomeObjectStoreStorage.php @@ -32,7 +32,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/Files/Storage/DAV.php b/lib/private/Files/Storage/DAV.php index a18168adfeca..94b457297697 100644 --- a/lib/private/Files/Storage/DAV.php +++ b/lib/private/Files/Storage/DAV.php @@ -92,7 +92,7 @@ public function __construct($params) { $this->statCache = new ArrayCache(); $this->httpClientService = \OC::$server->getHTTPClientService(); $this->webDavClientService = \OC::$server->getWebDavClientService(); - if (isset($params['host'], $params['user'], $params['password']) ) { + if (isset($params['host'], $params['user'], $params['password'])) { $host = $params['host']; //remove leading http[s], will be generated in createBaseUri() if (\substr($host, 0, 8) == "https://") $host = \substr($host, 8); diff --git a/lib/private/Files/Stream/Checksum.php b/lib/private/Files/Stream/Checksum.php index eeff8c364797..868304048385 100644 --- a/lib/private/Files/Stream/Checksum.php +++ b/lib/private/Files/Stream/Checksum.php @@ -140,7 +140,7 @@ private function updateHashingContexts($data) { private 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/Type/Detection.php b/lib/private/Files/Type/Detection.php index b3674c60a181..1e6412f2a64b 100644 --- a/lib/private/Files/Type/Detection.php +++ b/lib/private/Files/Type/Detection.php @@ -173,7 +173,7 @@ public function detectPath($path) { //try to guess the type by the file extension $extension = \strtolower(\strrchr($fileName, '.')); $extension = \substr($extension, 1); //remove leading . - return (isset($this->mimetypes[$extension], $this->mimetypes[$extension][0]) ) + return (isset($this->mimetypes[$extension], $this->mimetypes[$extension][0])) ? $this->mimetypes[$extension][0] : 'application/octet-stream'; } else { diff --git a/lib/private/Group/Database.php b/lib/private/Group/Database.php index eaafb473a2d2..eb2015141d0e 100644 --- a/lib/private/Group/Database.php +++ b/lib/private/Group/Database.php @@ -76,7 +76,7 @@ private function fixDI() { * Tries to create a new group. If the group name already exists, false will * be returned. */ - public function createGroup( $gid ) { + public function createGroup($gid) { $this->fixDI(); // Add group @@ -97,7 +97,7 @@ public function createGroup( $gid ) { * * Deletes a group and removes it from the group_user-table */ - public function deleteGroup( $gid ) { + public function deleteGroup($gid) { $this->fixDI(); // Delete the group @@ -132,7 +132,7 @@ public function deleteGroup( $gid ) { * * Checks whether the user is member of a group or not. */ - public function inGroup( $uid, $gid ) { + public function inGroup($uid, $gid) { $this->fixDI(); // check @@ -157,11 +157,11 @@ public function inGroup( $uid, $gid ) { * * Adds a user to a group. */ - public function addToGroup( $uid, $gid ) { + public function addToGroup($uid, $gid) { $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)) @@ -181,7 +181,7 @@ public function addToGroup( $uid, $gid ) { * * removes the user from a group. */ - public function removeFromGroup( $uid, $gid ) { + public function removeFromGroup($uid, $gid) { $this->fixDI(); $qb = $this->dbConn->getQueryBuilder(); @@ -201,7 +201,7 @@ public function removeFromGroup( $uid, $gid ) { * This function fetches all groups a user belongs to. It does not check * if the user exists at all. */ - public function getUserGroups( $uid ) { + public function getUserGroups($uid) { $this->fixDI(); // No magic! @@ -212,7 +212,7 @@ public function getUserGroups( $uid ) { ->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 c49c009af34c..6094640d053a 100644 --- a/lib/private/Installer.php +++ b/lib/private/Installer.php @@ -89,7 +89,7 @@ class Installer { * @throws \Exception * @return integer */ - public static function installApp( $data = []) { + public static function installApp($data = []) { $l = \OC::$server->getL10N('lib'); list($extractDir, $path) = self::downloadApp($data); @@ -183,7 +183,7 @@ public static function installApp( $data = []) { * * Checks whether or not an app is installed, i.e. registered in apps table. */ - public static function isInstalled( $app ) { + public static function isInstalled($app) { return (\OC::$server->getConfig()->getAppValue($app, "installed_version", null) !== null); } @@ -402,7 +402,7 @@ public static function checkAppsIntegrity($data, $extractDir, $path, $isShipped * * The function will check if the app is already downloaded in the apps repository */ - public static function isDownloaded( $name ) { + public static function isDownloaded($name) { foreach(\OC::$APPSROOTS as $dir) { $dirToTest = $dir['path']; $dirToTest .= '/'; @@ -433,7 +433,7 @@ public static function isDownloaded( $name ) { */ public static function removeApp($appId) { - if(Installer::isDownloaded( $appId )) { + if(Installer::isDownloaded($appId)) { $appDir = OC_App::getAppPath($appId); if ($appDir === false) { return false; @@ -454,11 +454,11 @@ public static function removeApp($appId) { protected static function getShippedApps() { $shippedApps = []; foreach(\OC::$APPSROOTS as $app_dir) { - if($dir = \opendir( $app_dir['path'] )) { + if($dir = \opendir($app_dir['path'])) { $nodes = \scandir($app_dir['path']); foreach($nodes as $filename) { - if( \substr( $filename, 0, 1 ) != '.' and \is_dir($app_dir['path']."/$filename") ) { - if( \file_exists( $app_dir['path']."/$filename/appinfo/info.xml" )) { + if(\substr($filename, 0, 1) != '.' and \is_dir($app_dir['path']."/$filename")) { + if(\file_exists($app_dir['path']."/$filename/appinfo/info.xml")) { if(!Installer::isInstalled($filename)) { $info=OC_App::getAppInfo($filename); $enabled = isset($info['default_enable']); @@ -470,7 +470,7 @@ protected static function getShippedApps() { } } } - \closedir( $dir ); + \closedir($dir); } } @@ -577,7 +577,7 @@ public static function installShippedApp($app) { * @param $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 77b00c0d67c5..e5ad91be0d5d 100644 --- a/lib/private/L10N/Factory.php +++ b/lib/private/L10N/Factory.php @@ -371,7 +371,7 @@ protected function getActiveLegacyThemeDirectory() { */ protected function getActiveAppThemeDirectory() { $theme = $this->themeService->getTheme(); - if ($theme instanceof ITheme && $theme->getDirectory() !== '' ) { + if ($theme instanceof ITheme && $theme->getDirectory() !== '') { return $theme->getBaseDirectory(). '/' . $theme->getDirectory(); } return ''; diff --git a/lib/private/Log/Owncloud.php b/lib/private/Log/Owncloud.php index 3412b14f646e..9641d926b222 100644 --- a/lib/private/Log/Owncloud.php +++ b/lib/private/Log/Owncloud.php @@ -74,7 +74,7 @@ public static function write($app, $message, $level, $conditionalLogFile = null) // default to ISO8601 $format = $config->getValue('logdateformat', 'c'); - $logTimeZone = $config->getValue( "logtimezone", 'UTC' ); + $logTimeZone = $config->getValue("logtimezone", 'UTC'); try { $timezone = new \DateTimeZone($logTimeZone); } catch (\Exception $e) { diff --git a/lib/private/Repair/SharePropagation.php b/lib/private/Repair/SharePropagation.php index 885453b78612..00017b229fd5 100644 --- a/lib/private/Repair/SharePropagation.php +++ b/lib/private/Repair/SharePropagation.php @@ -43,7 +43,7 @@ public function getName() { return 'Remove old share propagation app entries'; } - public function run(IOutput $out ) { + public function run(IOutput $out) { $keys = $this->config->getAppKeys('files_sharing'); foreach ($keys as $key) { diff --git a/lib/private/Search.php b/lib/private/Search.php index 4edf9e4c2ed8..ad5f77345089 100644 --- a/lib/private/Search.php +++ b/lib/private/Search.php @@ -61,7 +61,7 @@ public function searchPaged($query, array $inApps = [], $page = 1, $size = 30) { $results = []; foreach($this->providers as $provider) { /** @var $provider Provider */ - if ( ! $provider->providesResultsFor($inApps) ) { + if (! $provider->providesResultsFor($inApps)) { continue; } if ($provider instanceof PagedProvider) { @@ -117,7 +117,7 @@ public function registerProvider($class, array $options = []) { * 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/Server.php b/lib/private/Server.php index b53a7ad95916..e36f7e2b02d3 100644 --- a/lib/private/Server.php +++ b/lib/private/Server.php @@ -684,7 +684,7 @@ public function __construct($webRoot, \OC\Config $config) { 'server' => $_SERVER, 'env' => $_ENV, 'cookies' => $_COOKIE, - 'method' => (isset($_SERVER, $_SERVER['REQUEST_METHOD']) ) + 'method' => (isset($_SERVER, $_SERVER['REQUEST_METHOD'])) ? $_SERVER['REQUEST_METHOD'] : null, 'urlParams' => $urlParams, @@ -764,7 +764,7 @@ public function __construct($webRoot, \OC\Config $config) { 'server' => $_SERVER, 'env' => $_ENV, 'cookies' => $_COOKIE, - 'method' => (isset($_SERVER, $_SERVER['REQUEST_METHOD']) ) + 'method' => (isset($_SERVER, $_SERVER['REQUEST_METHOD'])) ? $_SERVER['REQUEST_METHOD'] : null, ], diff --git a/lib/private/Setup/OCI.php b/lib/private/Setup/OCI.php index b6f557b626da..27b7878b2c76 100644 --- a/lib/private/Setup/OCI.php +++ b/lib/private/Setup/OCI.php @@ -167,7 +167,7 @@ public function setupDatabase($username) { if (!$stmt) { $entry = $this->trans->t('DB Error: "%s"', [$this->getLastError($connection)]) . '
'; $entry .= $this->trans->t('Offending command was: "%s"', [$query]) . '
'; - $this->logger->warning( $entry, ['app' => 'setup.oci']); + $this->logger->warning($entry, ['app' => 'setup.oci']); } $result = \oci_execute($stmt); diff --git a/lib/private/Share/Share.php b/lib/private/Share/Share.php index de71979a2bec..7ca360aa67f0 100644 --- a/lib/private/Share/Share.php +++ b/lib/private/Share/Share.php @@ -984,7 +984,7 @@ public static function unshare($itemType, $itemSource, $shareType, $shareWith, $ */ public static function unshareAll($itemType, $itemSource) { // Get all of the owners of shares of this item. - $query = \OC_DB::prepare( 'SELECT `uid_owner` from `*PREFIX*share` WHERE `item_type`=? AND `item_source`=?' ); + $query = \OC_DB::prepare('SELECT `uid_owner` from `*PREFIX*share` WHERE `item_type`=? AND `item_source`=?'); $result = $query->execute([$itemType, $itemSource]); $shares = []; // Add each owner's shares to the array of all shares for this item. @@ -1898,7 +1898,7 @@ public static function getItems($itemType, $item = null, $shareType = null, $sha } } // Remove root from file source paths if retrieving own shared items - if (isset($uidOwner, $row['path']) ) { + if (isset($uidOwner, $row['path'])) { if (isset($row['parent'])) { $query = \OC_DB::prepare('SELECT `file_target` FROM `*PREFIX*share` WHERE `id` = ?'); $parentResult = $query->execute([$row['parent']]); @@ -1944,7 +1944,7 @@ public static function getItems($itemType, $item = null, $shareType = null, $sha } // 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) { $row['share_with_displayname'] = \OCP\User::getDisplayName($row['share_with']); } else if(isset($row['share_with']) && $row['share_with'] != '' && @@ -1958,7 +1958,7 @@ public static function getItems($itemType, $item = null, $shareType = null, $sha } } } - if ( isset($row['uid_owner']) && $row['uid_owner'] != '') { + if (isset($row['uid_owner']) && $row['uid_owner'] != '') { $row['displayname_owner'] = \OCP\User::getDisplayName($row['uid_owner']); } @@ -2106,7 +2106,7 @@ protected static function groupItems($items, $itemType) { // 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'])) { @@ -2516,8 +2516,8 @@ public static function checkPasswordProtectedShare(array $linkItem) { return true; } - if ( \OC::$server->getSession()->exists('public_link_authenticated') - && \OC::$server->getSession()->get('public_link_authenticated') === (string)$linkItem['id'] ) { + if (\OC::$server->getSession()->exists('public_link_authenticated') + && \OC::$server->getSession()->get('public_link_authenticated') === (string)$linkItem['id']) { return true; } diff --git a/lib/private/Tags.php b/lib/private/Tags.php index 8fc01b180fd2..93c34a92d115 100644 --- a/lib/private/Tags.php +++ b/lib/private/Tags.php @@ -295,7 +295,7 @@ public function getIdsForTag($tag) { } if(!\is_null($result)) { - while( $row = $result->fetchRow()) { + while($row = $result->fetchRow()) { $id = (int)$row['objid']; if ($this->includeShared) { @@ -435,7 +435,7 @@ public function addMultiple($names, $sync=false, $id = null) { 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]; } @@ -523,7 +523,7 @@ public static function post_deleteUser($arguments) { try { $stmt = \OCP\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 3e831fd46f6a..ef2f70d3f142 100644 --- a/lib/private/Template/Base.php +++ b/lib/private/Template/Base.php @@ -159,7 +159,7 @@ public function assign($key, $value) { * $_[$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{ @@ -175,7 +175,7 @@ public function append($key, $value) { */ public function printPage() { $data = $this->fetchPage(); - if( $data === false ) { + if($data === false) { return false; } else{ @@ -212,8 +212,8 @@ protected function load($file, $additionalParams = null) { $l = $this->l10n; $theme = $this->themeDefaults; - if( !\is_null($additionalParams)) { - $_ = \array_merge( $additionalParams, $this->vars ); + if(!\is_null($additionalParams)) { + $_ = \array_merge($additionalParams, $this->vars); } \ob_start(); diff --git a/lib/private/Template/CSSResourceLocator.php b/lib/private/Template/CSSResourceLocator.php index 9b0fafbe7bc7..19e0bb8c31d5 100644 --- a/lib/private/Template/CSSResourceLocator.php +++ b/lib/private/Template/CSSResourceLocator.php @@ -42,7 +42,7 @@ public function doFind($style) { $fullStyle = \substr($fullStyle, \strpos($fullStyle, '/')+1); $app_path = $this->appManager->getAppPath($app); - if( $app_path === false ) { return; } + if($app_path === false) { return; } $app_url = $this->appManager->getAppWebPath($app); $app_url = ($app_url !== false) ? $app_url : null; $this->appendOnceIfExist($app_path, $fullStyle, $app_url); diff --git a/lib/private/Template/JSResourceLocator.php b/lib/private/Template/JSResourceLocator.php index bbe51e258344..575c4670a4fa 100644 --- a/lib/private/Template/JSResourceLocator.php +++ b/lib/private/Template/JSResourceLocator.php @@ -64,7 +64,7 @@ public function doFind($script) { $app = \substr($fullScript, 0, \strpos($fullScript, '/')); $fullScript = \substr($fullScript, \strpos($fullScript, '/')+1); $app_path = $this->appManager->getAppPath($app); - if( $app_path === false ) { return; } + if($app_path === false) { return; } $app_url = $this->appManager->getAppWebPath($app); $app_url = ($app_url !== false) ? $app_url : null; diff --git a/lib/private/Template/ResourceLocator.php b/lib/private/Template/ResourceLocator.php index ab73637c9fd9..92c5a81e3f7b 100644 --- a/lib/private/Template/ResourceLocator.php +++ b/lib/private/Template/ResourceLocator.php @@ -119,7 +119,7 @@ protected function appendOnceIfExist($root, $file, $webRoot = null) { $file = \ltrim($file, '/'); $path = $this->buildPath([$root, $file]); - if (!isset( $this->resources[$path] ) && \is_file($path)) { + if (!isset($this->resources[$path]) && \is_file($path)) { $this->append($root, $file, $webRoot, false); return true; } @@ -143,7 +143,7 @@ protected function append($root, $file, $webRoot = null, $throw = true) { $path = $this->buildPath([$root, $file]); $this->resources[$path] = [$root, $webRoot, $file]; - if ($throw && !\is_file($path) ) { + if ($throw && !\is_file($path)) { throw new ResourceNotFoundException($file, $webRoot); } } diff --git a/lib/private/Template/TemplateFileLocator.php b/lib/private/Template/TemplateFileLocator.php index 2ff44e1c026d..ea6de642d77b 100644 --- a/lib/private/Template/TemplateFileLocator.php +++ b/lib/private/Template/TemplateFileLocator.php @@ -31,7 +31,7 @@ class TemplateFileLocator { /** * @param string[] $dirs */ - public function __construct( $dirs ) { + public function __construct($dirs) { $this->dirs = $dirs; } @@ -40,7 +40,7 @@ public function __construct( $dirs ) { * @return string * @throws \Exception */ - public function find( $template ) { + public function find($template) { if ($template === '') { throw new \InvalidArgumentException('Empty template name'); } diff --git a/lib/private/TemplateLayout.php b/lib/private/TemplateLayout.php index 0ef3ce3987cf..b55bbb455e09 100644 --- a/lib/private/TemplateLayout.php +++ b/lib/private/TemplateLayout.php @@ -50,14 +50,14 @@ class TemplateLayout extends \OC_Template { * @param string $renderAs * @param string $appId application id */ - public function __construct( $renderAs, $appId = '' ) { + public function __construct($renderAs, $appId = '') { // yes - should be injected .... $this->config = \OC::$server->getConfig(); // 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{ @@ -71,22 +71,22 @@ public function __construct( $renderAs, $appId = '' ) { } // Add navigation entry - $this->assign( 'application', ''); - $this->assign( 'appid', $appId ); + $this->assign('application', ''); + $this->assign('appid', $appId); $navigation = \OC_App::getNavigation(); - $this->assign( 'navigation', $navigation); + $this->assign('navigation', $navigation); $settingsNavigation = \OC_App::getSettingsNavigation(); - $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; } } @@ -132,12 +132,12 @@ public function __construct( $renderAs, $appId = '' ) { $jsFiles = self::findJavascriptFiles(\OC_Util::$scripts); $this->assign('jsfiles', []); if ($this->config->getSystemValue('installed', false) && $renderAs != 'error') { - $this->append( 'jsfiles', \OC::$server->getURLGenerator()->linkToRoute('js_config', ['v' => self::$versionHash])); + $this->append('jsfiles', \OC::$server->getURLGenerator()->linkToRoute('js_config', ['v' => self::$versionHash])); } foreach($jsFiles as $info) { $web = $info[1]; $file = $info[2]; - $this->append( 'jsfiles', $web.'/'.$file . '?v=' . self::$versionHash); + $this->append('jsfiles', $web.'/'.$file . '?v=' . self::$versionHash); } // Add the css files @@ -149,9 +149,9 @@ public function __construct( $renderAs, $appId = '' ) { $file = $info[2]; if (\substr($file, -\strlen('print.css')) === 'print.css') { - $this->append( 'printcssfiles', $web.'/'.$file . '?v=' . self::$versionHash); + $this->append('printcssfiles', $web.'/'.$file . '?v=' . self::$versionHash); } else { - $this->append( 'cssfiles', $web.'/'.$file . '?v=' . self::$versionHash); + $this->append('cssfiles', $web.'/'.$file . '?v=' . self::$versionHash); } } } diff --git a/lib/private/URLGenerator.php b/lib/private/URLGenerator.php index 78bd0344dceb..fe7d28633c91 100644 --- a/lib/private/URLGenerator.php +++ b/lib/private/URLGenerator.php @@ -100,10 +100,10 @@ public function linkToRouteAbsolute($routeName, $arguments = []) { * * Returns a url to the given app and file. */ - public function linkTo( $app, $file, $args = []) { + public function linkTo($app, $file, $args = []) { $frontControllerActive = (\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)) { @@ -190,7 +190,7 @@ private function getImagePath($app, $imageName) { $file = $directory . $imageName; if ($themeDirectory !== '' - && $imagePath = $this->getImagePathOrFallback( $this->theme->getBaseDirectory() . '/' . $themeDirectory . $file) + && $imagePath = $this->getImagePathOrFallback($this->theme->getBaseDirectory() . '/' . $themeDirectory . $file) ) { return $this->theme->getWebPath() . $file; } diff --git a/lib/private/User/Backend.php b/lib/private/User/Backend.php index d2c2ea615b03..3a1b9b588c07 100644 --- a/lib/private/User/Backend.php +++ b/lib/private/User/Backend.php @@ -95,7 +95,7 @@ public function implementsActions($actions) { * * Deletes a user */ - public function deleteUser( $uid ) { + public function deleteUser($uid) { return false; } @@ -149,7 +149,7 @@ public function getDisplayName($uid) { 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/Manager.php b/lib/private/User/Manager.php index 7095409c6278..2b805fe567c5 100644 --- a/lib/private/User/Manager.php +++ b/lib/private/User/Manager.php @@ -204,7 +204,7 @@ protected function getUserObject(Account $account, $cacheUser = true) { return $this->cachedUsers->get($account->getUserId()); } - $user = new User($account, $this->accountMapper, $this, $this->config, null, \OC::$server->getEventDispatcher() ); + $user = new User($account, $this->accountMapper, $this, $this->config, null, \OC::$server->getEventDispatcher()); if ($cacheUser) { $this->cachedUsers->set($account->getUserId(), $user); } diff --git a/lib/private/User/RemoteUser.php b/lib/private/User/RemoteUser.php index 0a72b4055986..beabb20b7697 100644 --- a/lib/private/User/RemoteUser.php +++ b/lib/private/User/RemoteUser.php @@ -160,7 +160,7 @@ public function getAvatarImage($size) { public function getCloudId() { $uid = $this->getUID(); $server = \OC::$server->getURLGenerator()->getAbsoluteURL('/'); - return $uid . '@' . \rtrim( $this->removeProtocolFromUrl($server), '/'); + return $uid . '@' . \rtrim($this->removeProtocolFromUrl($server), '/'); } /** diff --git a/lib/private/User/Session.php b/lib/private/User/Session.php index bc674b4d7288..edbabb920bb6 100644 --- a/lib/private/User/Session.php +++ b/lib/private/User/Session.php @@ -342,7 +342,7 @@ public function logClientIn($user, $password, IRequest $request) { if (!$isTokenPassword && $this->isTwoFactorEnforced($user)) { throw new PasswordLoginForbiddenException(); } - if (!$this->login($user, $password) ) { + if (!$this->login($user, $password)) { $users = $this->manager->getByEmail($user); if (\count($users) === 1) { return $this->login($users[0]->getUID(), $password); diff --git a/lib/private/User/User.php b/lib/private/User/User.php index 07d6da0841d2..ca5970e51b5f 100644 --- a/lib/private/User/User.php +++ b/lib/private/User/User.php @@ -456,7 +456,7 @@ public function getAvatarImage($size) { public function getCloudId() { $uid = $this->getUID(); $server = $this->urlGenerator->getAbsoluteURL('/'); - return $uid . '@' . \rtrim( $this->removeProtocolFromUrl($server), '/'); + return $uid . '@' . \rtrim($this->removeProtocolFromUrl($server), '/'); } /** diff --git a/lib/private/legacy/db.php b/lib/private/legacy/db.php index 2aaa91619649..9a3e7e2de0e8 100644 --- a/lib/private/legacy/db.php +++ b/lib/private/legacy/db.php @@ -52,7 +52,7 @@ private static function getMDB2SchemaManager() { * * SQL query via Doctrine prepare(), needs to be execute()'d! */ - static public function prepare( $query , $limit = null, $offset = null, $isManipulation = null) { + static public function prepare($query , $limit = null, $offset = null, $isManipulation = null) { $connection = \OC::$server->getDatabaseConnection(); if ($isManipulation === null) { @@ -78,7 +78,7 @@ static public function prepare( $query , $limit = null, $offset = null, $isManip * @param string $sql * @return bool */ - static public function isManipulation( $sql ) { + static public function isManipulation($sql) { $selectOccurrence = \stripos($sql, 'SELECT'); if ($selectOccurrence !== false && $selectOccurrence < 10) { return false; @@ -107,7 +107,7 @@ static public function isManipulation( $sql ) { * @return OC_DB_StatementWrapper * @throws \OC\DatabaseException */ - static public function executeAudited( $stmt, array $parameters = null) { + static public function executeAudited($stmt, array $parameters = null) { if (\is_string($stmt)) { // convert to an array with 'sql' if (\stripos($stmt, 'LIMIT') !== false) { //OFFSET requires LIMIT, so we only need to check for LIMIT @@ -120,14 +120,14 @@ static public function executeAudited( $stmt, array $parameters = null) { } 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']); @@ -167,7 +167,7 @@ public static function getDbStructure($file) { * * TODO: write more documentation */ - public static function createDbFromStructure( $file ) { + public static function createDbFromStructure($file) { $schemaManager = self::getMDB2SchemaManager(); $result = $schemaManager->createDbFromStructure($file); return $result; diff --git a/lib/private/legacy/hook.php b/lib/private/legacy/hook.php index b58ccfef23a7..c1741e87cb53 100644 --- a/lib/private/legacy/hook.php +++ b/lib/private/legacy/hook.php @@ -45,15 +45,15 @@ class OC_Hook{ * * TODO: write example */ - static public function connect($signalClass, $signalName, $slotClass, $slotName ) { + 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] = []; } @@ -89,20 +89,20 @@ static public function emit($signalClass, $signalName, $params = []) { // 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/json.php b/lib/private/legacy/json.php index f5a435cd2180..f1686870548d 100644 --- a/lib/private/legacy/json.php +++ b/lib/private/legacy/json.php @@ -44,7 +44,7 @@ class OC_JSON{ public static function setContentTypeHeader($type='application/json') { if (!self::$send_content_type_header) { // We send json data - \header( 'Content-Type: '.$type . '; charset=utf-8'); + \header('Content-Type: '.$type . '; charset=utf-8'); self::$send_content_type_header = true; } } @@ -55,7 +55,7 @@ public static function setContentTypeHeader($type='application/json') { * @deprecated Use the AppFramework instead. It will automatically check if the app is enabled. */ public static function checkAppEnabled($app) { - if( !OC_App::isEnabled($app)) { + if(!OC_App::isEnabled($app)) { $l = \OC::$server->getL10N('lib'); self::error(['data' => ['message' => $l->t('Application is not enabled'), 'error' => 'application_not_enabled']]); exit(); @@ -74,7 +74,7 @@ public static function checkLoggedIn() { } $twoFactorAuthManger = \OC::$server->getTwoFactorAuthManager(); - if( !OC_User::isLoggedIn() + if(!OC_User::isLoggedIn() || $twoFactorAuthManger->needsSecondFactor()) { $l = \OC::$server->getL10N('lib'); \http_response_code(\OCP\AppFramework\Http::STATUS_UNAUTHORIZED); @@ -88,7 +88,7 @@ public static function checkLoggedIn() { * @deprecated Use annotation based CSRF checks from the AppFramework instead */ public static function callCheck() { - 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(); @@ -100,7 +100,7 @@ public static function callCheck() { * @deprecated Use annotation based ACLs from the AppFramework instead */ 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(); diff --git a/lib/private/legacy/response.php b/lib/private/legacy/response.php index 443d054b9817..5fcbae352965 100644 --- a/lib/private/legacy/response.php +++ b/lib/private/legacy/response.php @@ -180,17 +180,17 @@ static public function setLastModifiedHeader($lastModified) { * @param string $filename file name * @param string $type disposition type, either 'attachment' or 'inline' */ - static public function setContentDispositionHeader( $filename, $type = 'attachment' ) { + static public function setContentDispositionHeader($filename, $type = 'attachment') { if (\OC::$server->getRequest()->isUserAgent( [ \OC\AppFramework\Http\Request::USER_AGENT_IE, \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/template.php b/lib/private/legacy/template.php index 31c1d2ffd429..6fd2f6061a6a 100644 --- a/lib/private/legacy/template.php +++ b/lib/private/legacy/template.php @@ -77,7 +77,7 @@ class OC_Template extends \OC\Template\Base { * "admin". * @param bool $registerCall = true */ - public function __construct( $app, $name, $renderAs = "", $registerCall = true ) { + public function __construct($app, $name, $renderAs = "", $registerCall = true) { self::initTemplateEngine($renderAs); $requestToken = (OC::$server->getSession() && $registerCall) ? \OCP\Util::callRegister() : ''; @@ -104,8 +104,8 @@ public static function initTemplateEngine($renderAs) { //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); } } @@ -198,7 +198,7 @@ protected function findTemplate($theme, $app, $name) { $dirs = $this->getAppTemplateDirs($theme, $app, OC_App::getAppPath($app)); } - $locator = new \OC\Template\TemplateFileLocator( $dirs ); + $locator = new \OC\Template\TemplateFileLocator($dirs); $template = $locator->find($name); return $template; @@ -231,7 +231,7 @@ public function addHeader($tag, $attributes, $text=null) { public function fetchPage($additionalParams = null) { $data = parent::fetchPage($additionalParams); - if( $this->renderAs ) { + if($this->renderAs) { $page = new TemplateLayout($this->renderAs, $this->app); // Add custom headers @@ -279,10 +279,10 @@ public function inc($file, $additionalParams = null) { * @param array $parameters Parameters for the template * @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 ); + public static function printUserPage($application, $name, $parameters = []) { + $content = new OC_Template($application, $name, "user"); + foreach($parameters as $key => $value) { + $content->assign($key, $value); } print $content->printPage(); } @@ -294,10 +294,10 @@ public static function printUserPage( $application, $name, $parameters = []) { * @param array $parameters Parameters for the template * @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 ); + public static function printAdminPage($application, $name, $parameters = []) { + $content = new OC_Template($application, $name, "admin"); + foreach($parameters as $key => $value) { + $content->assign($key, $value); } return $content->printPage(); } @@ -309,10 +309,10 @@ public static function printAdminPage( $application, $name, $parameters = []) { * @param array|string $parameters Parameters for the template * @return bool */ - public static function printGuestPage( $application, $name, $parameters = []) { - $content = new OC_Template( $application, $name, "guest" ); - foreach( $parameters as $key => $value ) { - $content->assign( $key, $value ); + public static function printGuestPage($application, $name, $parameters = []) { + $content = new OC_Template($application, $name, "guest"); + foreach($parameters as $key => $value) { + $content->assign($key, $value); } return $content->printPage(); } @@ -323,16 +323,16 @@ public static function printGuestPage( $application, $name, $parameters = []) { * @param string $hint An optional hint message - needs to be properly escaped * @param int HTTP Status Code */ - public static function printErrorPage( $error_msg, $hint = '', $httpStatusCode = null ) { + public static function printErrorPage($error_msg, $hint = '', $httpStatusCode = null) { if ($error_msg === $hint) { // If the hint is the same as the message there is no need to display it twice. $hint = ''; } 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); if ($httpStatusCode !== null) { \http_response_code((int)$httpStatusCode); } diff --git a/lib/private/legacy/template/functions.php b/lib/private/legacy/template/functions.php index 56471f7bb124..a6552091d773 100644 --- a/lib/private/legacy/template/functions.php +++ b/lib/private/legacy/template/functions.php @@ -145,7 +145,7 @@ function component($app, $file) { * * For further information have a look at \OCP\IURLGenerator::linkTo */ -function link_to( $app, $file, $args = []) { +function link_to($app, $file, $args = []) { return \OC::$server->getURLGenerator()->linkTo($app, $file, $args); } @@ -165,8 +165,8 @@ 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 ); +function image_path($app, $image) { + return \OC::$server->getURLGenerator()->imagePath($app, $image); } /** @@ -174,8 +174,8 @@ function image_path( $app, $image ) { * @param string $mimetype mimetype * @return string link to the image */ -function mimetype_icon( $mimetype ) { - return \OC::$server->getMimeTypeDetector()->mimeTypeIcon( $mimetype ); +function mimetype_icon($mimetype) { + return \OC::$server->getMimeTypeDetector()->mimeTypeIcon($mimetype); } /** @@ -184,14 +184,14 @@ function mimetype_icon( $mimetype ) { * @param string $path path of file * @return string link to the preview */ -function preview_icon( $path ) { +function preview_icon($path) { return \OC::$server->getURLGenerator()->linkToRoute('core_ajax_preview', ['x' => 32, 'y' => 32, 'file' => $path]); } /** * @param string $path */ -function publicPreview_icon ( $path, $token ) { +function publicPreview_icon ($path, $token) { return \OC::$server->getURLGenerator()->linkToRoute('core_ajax_public_preview', ['x' => 32, 'y' => 32, 'file' => $path, 't' => $token]); } @@ -202,8 +202,8 @@ 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 ); +function human_file_size($bytes) { + return OC_Helper::humanFileSize($bytes); } /** diff --git a/lib/private/legacy/util.php b/lib/private/legacy/util.php index 562954c17674..0cf4bc42562f 100644 --- a/lib/private/legacy/util.php +++ b/lib/private/legacy/util.php @@ -564,7 +564,7 @@ public static function addScript($application, $file = null, $prepend = false) { // core js files need separate handling if ($application !== 'core' && $file !== null) { - self::addTranslations ( $application ); + self::addTranslations ($application); } self::addExternalResource($application, $prepend, $path, "script"); } @@ -641,7 +641,7 @@ private static function addExternalResource($application, $prepend, $path, $type 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; } @@ -649,7 +649,7 @@ private static function addExternalResource($application, $prepend, $path, $type } 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; } diff --git a/lib/public/App.php b/lib/public/App.php index 2343f692161b..89347e0ac027 100644 --- a/lib/public/App.php +++ b/lib/public/App.php @@ -81,7 +81,7 @@ public static function addNavigationEntry($data) { * @deprecated 8.1.0 Use \OC::$server->getNavigationManager()->setActiveEntry() instead * @since 4.0.0 */ - public static function setActiveNavigationEntry( $id ) { + public static function setActiveNavigationEntry($id) { \OC::$server->getNavigationManager()->setActiveEntry($id); return true; } @@ -93,8 +93,8 @@ public static function setActiveNavigationEntry( $id ) { * @return void * @since 4.0.0 */ - public static function registerPersonal( $app, $page ) { - \OC_App::registerPersonal( $app, $page ); + public static function registerPersonal($app, $page) { + \OC_App::registerPersonal($app, $page); } /** @@ -104,8 +104,8 @@ public static function registerPersonal( $app, $page ) { * @return void * @since 4.0.0 */ - public static function registerAdmin( $app, $page ) { - \OC_App::registerAdmin( $app, $page ); + public static function registerAdmin($app, $page) { + \OC_App::registerAdmin($app, $page); } /** @@ -115,8 +115,8 @@ public static function registerAdmin( $app, $page ) { * @return array|null * @since 4.0.0 */ - public static function getAppInfo( $app, $path=false ) { - return \OC_App::getAppInfo( $app, $path); + public static function getAppInfo($app, $path=false) { + return \OC_App::getAppInfo($app, $path); } /** @@ -127,8 +127,8 @@ public static function getAppInfo( $app, $path=false ) { * This function checks whether or not an app is enabled. * @since 4.0.0 */ - public static function isEnabled( $app ) { - return \OC_App::isEnabled( $app ); + public static function isEnabled($app) { + return \OC_App::isEnabled($app); } /** @@ -138,7 +138,7 @@ public static function isEnabled( $app ) { * @since 4.0.0 * @deprecated 9.0.0 ownCloud core will handle disabled apps and redirects to valid URLs */ - public static function checkAppEnabled( $app ) { + public static function checkAppEnabled($app) { } /** @@ -147,7 +147,7 @@ public static function checkAppEnabled( $app ) { * @return string * @since 4.0.0 */ - public static function getAppVersion( $app ) { - return \OC_App::getAppVersion( $app ); + public static function getAppVersion($app) { + return \OC_App::getAppVersion($app); } } diff --git a/lib/public/AppFramework/Db/Entity.php b/lib/public/AppFramework/Db/Entity.php index ae484ef41e2e..ddbe54d14b28 100644 --- a/lib/public/AppFramework/Db/Entity.php +++ b/lib/public/AppFramework/Db/Entity.php @@ -140,7 +140,7 @@ protected function getter($name) { * @since 7.0.0 */ public function __call($methodName, $args){ - $attr = \lcfirst( \substr($methodName, 3) ); + $attr = \lcfirst(\substr($methodName, 3)); if(\strpos($methodName, 'set') === 0){ $this->setter($attr, $args); diff --git a/lib/public/AppFramework/Db/Mapper.php b/lib/public/AppFramework/Db/Mapper.php index a77edf190e4e..d656524da45a 100644 --- a/lib/public/AppFramework/Db/Mapper.php +++ b/lib/public/AppFramework/Db/Mapper.php @@ -296,7 +296,7 @@ protected function findOneQuery($sql, array $params=[], $limit=null, $offset=nul $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/BackgroundJob.php b/lib/public/BackgroundJob.php index 75b0ed37f0f6..62089638eeeb 100644 --- a/lib/public/BackgroundJob.php +++ b/lib/public/BackgroundJob.php @@ -74,7 +74,7 @@ public static function getExecutionType() { * @since 5.0.0 */ public static function setExecutionType($type) { - if( !\in_array( $type, ['none', 'ajax', 'webcron', 'cron'])) { + if(!\in_array($type, ['none', 'ajax', 'webcron', 'cron'])) { return false; } \OC::$server->getConfig()->setAppValue('core', 'backgroundjobs_mode', $type); diff --git a/lib/public/Config.php b/lib/public/Config.php index 22deab576cbf..dc96d344f553 100644 --- a/lib/public/Config.php +++ b/lib/public/Config.php @@ -56,8 +56,8 @@ class Config { * This function gets the value from config.php. If it does not exist, * $default will be returned. */ - public static function getSystemValue( $key, $default = null ) { - return \OC::$server->getConfig()->getSystemValue( $key, $default ); + public static function getSystemValue($key, $default = null) { + return \OC::$server->getConfig()->getSystemValue($key, $default); } /** @@ -70,9 +70,9 @@ public static function getSystemValue( $key, $default = null ) { * This function sets the value and writes the config.php. If the file can * not be written, false will be returned. */ - public static function setSystemValue( $key, $value ) { + public static function setSystemValue($key, $value) { try { - \OC::$server->getConfig()->setSystemValue( $key, $value ); + \OC::$server->getConfig()->setSystemValue($key, $value); } catch (\Exception $e) { return false; } @@ -86,8 +86,8 @@ public static function setSystemValue( $key, $value ) { * * This function deletes the value from config.php. */ - public static function deleteSystemValue( $key ) { - \OC::$server->getConfig()->deleteSystemValue( $key ); + public static function deleteSystemValue($key) { + \OC::$server->getConfig()->deleteSystemValue($key); } /** @@ -101,8 +101,8 @@ public static function deleteSystemValue( $key ) { * This function gets a value from the appconfig table. If the key does * not exist the default value will be returned */ - public static function getAppValue( $app, $key, $default = null ) { - return \OC::$server->getConfig()->getAppValue( $app, $key, $default ); + public static function getAppValue($app, $key, $default = null) { + return \OC::$server->getConfig()->getAppValue($app, $key, $default); } /** @@ -115,9 +115,9 @@ public static function getAppValue( $app, $key, $default = null ) { * * Sets a value. If the key did not exist before it will be created. */ - public static function setAppValue( $app, $key, $value ) { + public static function setAppValue($app, $key, $value) { try { - \OC::$server->getConfig()->setAppValue( $app, $key, $value ); + \OC::$server->getConfig()->setAppValue($app, $key, $value); } catch (\Exception $e) { return false; } @@ -136,8 +136,8 @@ public static function setAppValue( $app, $key, $value ) { * This function gets a value from the preferences table. If the key does * not exist the default value will be returned */ - public static function getUserValue( $user, $app, $key, $default = null ) { - return \OC::$server->getConfig()->getUserValue( $user, $app, $key, $default ); + public static function getUserValue($user, $app, $key, $default = null) { + return \OC::$server->getConfig()->getUserValue($user, $app, $key, $default); } /** @@ -152,9 +152,9 @@ public static function getUserValue( $user, $app, $key, $default = null ) { * Adds a value to the preferences. If the key did not exist before, it * will be added automagically. */ - public static function setUserValue( $user, $app, $key, $value ) { + public static function setUserValue($user, $app, $key, $value) { try { - \OC::$server->getConfig()->setUserValue( $user, $app, $key, $value ); + \OC::$server->getConfig()->setUserValue($user, $app, $key, $value); } catch (\Exception $e) { return false; } diff --git a/lib/public/DB.php b/lib/public/DB.php index 9b358e3ed749..40e573878676 100644 --- a/lib/public/DB.php +++ b/lib/public/DB.php @@ -55,7 +55,7 @@ class DB { * @deprecated 8.1.0 use prepare() of \OCP\IDBConnection - \OC::$server->getDatabaseConnection() * @since 4.5.0 */ - static public function prepare( $query, $limit=null, $offset=null ) { + static public function prepare($query, $limit=null, $offset=null) { return(\OC_DB::prepare($query, $limit, $offset)); } diff --git a/lib/public/Files.php b/lib/public/Files.php index 8ed3e55007f4..924210c2c46d 100644 --- a/lib/public/Files.php +++ b/lib/public/Files.php @@ -49,8 +49,8 @@ class Files { * @return bool * @since 5.0.0 */ - static function rmdirr( $dir ) { - return \OC_Helper::rmdirr( $dir ); + static function rmdirr($dir) { + return \OC_Helper::rmdirr($dir); } /** @@ -60,7 +60,7 @@ static function rmdirr( $dir ) { * does NOT work for ownClouds filesystem, use OC_FileSystem::getMimeType instead * @since 5.0.0 */ - static function getMimeType( $path ) { + static function getMimeType($path) { return \OC::$server->getMimeTypeDetector()->detect($path); } @@ -70,8 +70,8 @@ static function getMimeType( $path ) { * @return array * @since 6.0.0 */ - static public function searchByMime( $mimetype ) { - return(\OC\Files\Filesystem::searchByMime( $mimetype )); + static public function searchByMime($mimetype) { + return(\OC\Files\Filesystem::searchByMime($mimetype)); } /** @@ -81,8 +81,8 @@ static public function searchByMime( $mimetype ) { * @return int the number of bytes copied * @since 5.0.0 */ - public static function streamCopy( $source, $target ) { - list($count, ) = \OC_Helper::streamCopy( $source, $target ); + public static function streamCopy($source, $target) { + list($count, ) = \OC_Helper::streamCopy($source, $target); return $count; } @@ -95,7 +95,7 @@ public static function streamCopy( $source, $target ) { * @deprecated 8.1.0 use getTemporaryFile() of \OCP\ITempManager - \OC::$server->getTempManager() * @since 5.0.0 */ - public static function tmpFile( $postfix='' ) { + public static function tmpFile($postfix='') { return \OC::$server->getTempManager()->getTemporaryFile($postfix); } @@ -118,8 +118,8 @@ public static function tmpFolder() { * @return string * @since 5.0.0 */ - public static function buildNotExistingFileName( $path, $filename ) { - return(\OC_Helper::buildNotExistingFileName( $path, $filename )); + public static function buildNotExistingFileName($path, $filename) { + return(\OC_Helper::buildNotExistingFileName($path, $filename)); } /** @@ -129,7 +129,7 @@ public static function buildNotExistingFileName( $path, $filename ) { * @return \OC\Files\View * @since 5.0.0 */ - public static function getStorage( $app ) { - return \OC_App::getStorage( $app ); + public static function getStorage($app) { + return \OC_App::getStorage($app); } } diff --git a/lib/public/JSON.php b/lib/public/JSON.php index 1051ecea35e2..f1ba61936b3a 100644 --- a/lib/public/JSON.php +++ b/lib/public/JSON.php @@ -45,7 +45,7 @@ class JSON { * @param bool $setContentType the optional content type * @deprecated 8.1.0 Use a AppFramework JSONResponse instead */ - public static function encodedPrint( $data, $setContentType=true ) { + public static function encodedPrint($data, $setContentType=true) { \OC_JSON::encodedPrint($data, $setContentType); } @@ -100,7 +100,7 @@ public static function callCheck() { * @return string json formatted string. * @deprecated 8.1.0 Use a AppFramework JSONResponse instead */ - public static function success( $data = []) { + public static function success($data = []) { \OC_JSON::success($data); } @@ -123,8 +123,8 @@ public static function success( $data = []) { * @return string json formatted error string. * @deprecated 8.1.0 Use a AppFramework JSONResponse instead */ - public static function error( $data = []) { - \OC_JSON::error( $data ); + public static function error($data = []) { + \OC_JSON::error($data); } /** @@ -132,7 +132,7 @@ public static function error( $data = []) { * @param string $type The content type header * @deprecated 8.1.0 Use a AppFramework JSONResponse instead */ - public static function setContentTypeHeader( $type='application/json' ) { + public static function setContentTypeHeader($type='application/json') { \OC_JSON::setContentTypeHeader($type); } @@ -152,7 +152,7 @@ public static function setContentTypeHeader( $type='application/json' ) { * @param string $app The app to check * @deprecated 8.1.0 Use the AppFramework instead. It will automatically check if the app is enabled. */ - public static function checkAppEnabled( $app ) { + public static function checkAppEnabled($app) { \OC_JSON::checkAppEnabled($app); } diff --git a/lib/public/Response.php b/lib/public/Response.php index 4d1901054daf..0aeea3fb1553 100644 --- a/lib/public/Response.php +++ b/lib/public/Response.php @@ -51,8 +51,8 @@ class Response { * null cache indefinitely * @since 4.0.0 */ - static public function enableCaching( $cache_time = null ) { - \OC_Response::enableCaching( $cache_time ); + static public function enableCaching($cache_time = null) { + \OC_Response::enableCaching($cache_time); } /** @@ -61,8 +61,8 @@ static public function enableCaching( $cache_time = null ) { * @param string $lastModified time when the response was last modified * @since 4.0.0 */ - static public function setLastModifiedHeader( $lastModified ) { - \OC_Response::setLastModifiedHeader( $lastModified ); + static public function setLastModifiedHeader($lastModified) { + \OC_Response::setLastModifiedHeader($lastModified); } /** @@ -71,8 +71,8 @@ static public function setLastModifiedHeader( $lastModified ) { * @param string $type disposition type, either 'attachment' or 'inline' * @since 7.0.0 */ - static public function setContentDispositionHeader( $filename, $type = 'attachment' ) { - \OC_Response::setContentDispositionHeader( $filename, $type ); + static public function setContentDispositionHeader($filename, $type = 'attachment') { + \OC_Response::setContentDispositionHeader($filename, $type); } /** @@ -99,8 +99,8 @@ static public function disableCaching() { * @param string $etag token to use for modification check * @since 4.0.0 */ - static public function setETagHeader( $etag ) { - \OC_Response::setETagHeader( $etag ); + static public function setETagHeader($etag) { + \OC_Response::setETagHeader($etag); } /** @@ -109,8 +109,8 @@ static public function setETagHeader( $etag ) { * @since 4.0.0 * @deprecated 8.1.0 - Use \OCP\AppFramework\Http\StreamResponse or another AppFramework controller instead */ - static public function sendFile( $filepath ) { - \OC_Response::sendFile( $filepath ); + static public function sendFile($filepath) { + \OC_Response::sendFile($filepath); } /** @@ -120,8 +120,8 @@ static public function sendFile( $filepath ) { * DateTime object when to expire response * @since 4.0.0 */ - static public function setExpiresHeader( $expires ) { - \OC_Response::setExpiresHeader( $expires ); + static public function setExpiresHeader($expires) { + \OC_Response::setExpiresHeader($expires); } /** @@ -129,7 +129,7 @@ static public function setExpiresHeader( $expires ) { * @param string $location to redirect to * @since 4.0.0 */ - static public function redirect( $location ) { - \OC_Response::redirect( $location ); + static public function redirect($location) { + \OC_Response::redirect($location); } } diff --git a/lib/public/Template.php b/lib/public/Template.php index 4d99c7e85dc0..ada9333d38d6 100644 --- a/lib/public/Template.php +++ b/lib/public/Template.php @@ -48,8 +48,8 @@ * @see \OCP\IURLGenerator::imagePath * @deprecated 8.0.0 Use \OCP\Template::image_path() instead */ -function image_path( $app, $image ) { - return(\image_path( $app, $image )); +function image_path($app, $image) { + return(\image_path($app, $image)); } @@ -59,8 +59,8 @@ function image_path( $app, $image ) { * @return string to the image of this file type. * @deprecated 8.0.0 Use \OCP\Template::mimetype_icon() instead */ -function mimetype_icon( $mimetype ) { - return(\mimetype_icon( $mimetype )); +function mimetype_icon($mimetype) { + return(\mimetype_icon($mimetype)); } /** @@ -69,8 +69,8 @@ function mimetype_icon( $mimetype ) { * @return string to the preview of the image * @deprecated 8.0.0 Use \OCP\Template::preview_icon() instead */ -function preview_icon( $path ) { - return(\preview_icon( $path )); +function preview_icon($path) { + return(\preview_icon($path)); } /** @@ -81,8 +81,8 @@ function preview_icon( $path ) { * @return string link to the preview * @deprecated 8.0.0 Use \OCP\Template::publicPreview_icon() instead */ -function publicPreview_icon ( $path, $token ) { - return(\publicPreview_icon( $path, $token )); +function publicPreview_icon ($path, $token) { + return(\publicPreview_icon($path, $token)); } /** @@ -92,8 +92,8 @@ function publicPreview_icon ( $path, $token ) { * @return string size as string * @deprecated 8.0.0 Use \OCP\Template::human_file_size() instead */ -function human_file_size( $bytes ) { - return(\human_file_size( $bytes )); +function human_file_size($bytes) { + return(\human_file_size($bytes)); } @@ -105,7 +105,7 @@ function human_file_size( $bytes ) { * * @deprecated 8.0.0 Use \OCP\Template::relative_modified_date() instead */ -function relative_modified_date( $timestamp, $dateOnly = false ) { +function relative_modified_date($timestamp, $dateOnly = false) { return(\relative_modified_date($timestamp, null, $dateOnly)); } diff --git a/lib/public/User.php b/lib/public/User.php index bb5dedd16ed3..669114140e77 100644 --- a/lib/public/User.php +++ b/lib/public/User.php @@ -64,8 +64,8 @@ public static function getUser() { * @deprecated 8.1.0 use method search() of \OCP\IUserManager - \OC::$server->getUserManager() * @since 5.0.0 */ - public static function getUsers( $search = '', $limit = null, $offset = null ) { - return \OC_User::getUsers( $search, $limit, $offset ); + public static function getUsers($search = '', $limit = null, $offset = null) { + return \OC_User::getUsers($search, $limit, $offset); } /** @@ -76,8 +76,8 @@ public static function getUsers( $search = '', $limit = null, $offset = null ) { * get() of \OCP\IUserManager - \OC::$server->getUserManager() * @since 5.0.0 */ - public static function getDisplayName( $user = null ) { - return \OC_User::getDisplayName( $user ); + public static function getDisplayName($user = null) { + return \OC_User::getDisplayName($user); } /** @@ -89,8 +89,8 @@ public static function getDisplayName( $user = null ) { * @deprecated 8.1.0 use method searchDisplayName() of \OCP\IUserManager - \OC::$server->getUserManager() * @since 5.0.0 */ - public static function getDisplayNames( $search = '', $limit = null, $offset = null ) { - return \OC_User::getDisplayNames( $search, $limit, $offset ); + public static function getDisplayNames($search = '', $limit = null, $offset = null) { + return \OC_User::getDisplayNames($search, $limit, $offset); } /** @@ -110,8 +110,8 @@ public static function isLoggedIn() { * @deprecated 8.1.0 use method userExists() of \OCP\IUserManager - \OC::$server->getUserManager() * @since 5.0.0 */ - public static function userExists( $uid, $excludingBackend = null ) { - return \OC_User::userExists( $uid); + public static function userExists($uid, $excludingBackend = null) { + return \OC_User::userExists($uid); } /** * Logs the user out including all the session data @@ -133,8 +133,8 @@ public static function logout() { * @deprecated 8.0.0 Use \OC::$server->getUserManager()->checkPassword(); * @since 5.0.0 */ - public static function checkPassword( $uid, $password ) { - return \OC_User::checkPassword( $uid, $password ); + public static function checkPassword($uid, $password) { + return \OC_User::checkPassword($uid, $password); } /** diff --git a/lib/public/Util.php b/lib/public/Util.php index 291fba5ab843..9156da314016 100644 --- a/lib/public/Util.php +++ b/lib/public/Util.php @@ -152,7 +152,7 @@ public static function sendMail($toaddress, $toname, $subject, $mailtext, $froma * @param int $level * @since 4.0.0 */ - public static function writeLog( $app, $message, $level ) { + public static function writeLog($app, $message, $level) { $context = ['app' => $app]; \OC::$server->getLogger()->log($level, $message, $context); } @@ -165,7 +165,7 @@ public static function writeLog( $app, $message, $level ) { * @since ....0.0 - parameter $level was added in 7.0.0 * @deprecated 8.2.0 use logException of \OCP\ILogger */ - public static function logException( $app, \Exception $ex, $level = \OCP\Util::FATAL ) { + public static function logException($app, \Exception $ex, $level = \OCP\Util::FATAL) { \OC::$server->getLogger()->logException($ex, ['app' => $app]); } @@ -212,8 +212,8 @@ public static function getL10N($application, $language = null) { * @param string $file * @since 4.0.0 */ - public static function addStyle( $application, $file = null ) { - \OC_Util::addStyle( $application, $file ); + public static function addStyle($application, $file = null) { + \OC_Util::addStyle($application, $file); } /** @@ -222,8 +222,8 @@ public static function addStyle( $application, $file = null ) { * @param string $file * @since 4.0.0 */ - public static function addScript( $application, $file = null ) { - \OC_Util::addScript( $application, $file ); + public static function addScript($application, $file = null) { + \OC_Util::addScript($application, $file); } /** @@ -283,7 +283,7 @@ public static function encryptedFiles() { * @return string the url * @since 4.0.0 - parameter $args was added in 4.5.0 */ - public static function linkToAbsolute( $app, $file, $args = []) { + public static function linkToAbsolute($app, $file, $args = []) { $urlGenerator = \OC::$server->getURLGenerator(); return $urlGenerator->getAbsoluteURL( $urlGenerator->linkTo($app, $file, $args) @@ -296,7 +296,7 @@ public static function linkToAbsolute( $app, $file, $args = []) { * @return string the url * @since 4.0.0 */ - public static function linkToRemote( $service ) { + public static function linkToRemote($service) { $urlGenerator = \OC::$server->getURLGenerator(); $remoteBase = $urlGenerator->linkTo('', 'remote.php') . '/' . $service; return $urlGenerator->getAbsoluteURL( @@ -323,7 +323,7 @@ public static function linkToPublic($service) { * @deprecated 8.1.0 Use \OC::$server->getURLGenerator()->linkToRoute($route, $parameters) * @since 5.0.0 */ - public static function linkToRoute( $route, $parameters = []) { + public static function linkToRoute($route, $parameters = []) { return \OC::$server->getURLGenerator()->linkToRoute($route, $parameters); } @@ -337,7 +337,7 @@ public static function linkToRoute( $route, $parameters = []) { * @deprecated 8.1.0 Use \OC::$server->getURLGenerator()->linkTo($app, $file, $args) * @since 4.0.0 - parameter $args was added in 4.5.0 */ - public static function linkTo( $app, $file, $args = []) { + public static function linkTo($app, $file, $args = []) { return \OC::$server->getURLGenerator()->linkTo($app, $file, $args); } @@ -436,7 +436,7 @@ public static function getScriptName() { * @deprecated 8.1.0 Use \OC::$server->getURLGenerator()->imagePath($app, $image) * @since 4.0.0 */ - public static function imagePath( $app, $image ) { + public static function imagePath($app, $image) { return \OC::$server->getURLGenerator()->imagePath($app, $image); } @@ -446,8 +446,8 @@ public static function imagePath( $app, $image ) { * @return string a human readable file size * @since 4.0.0 */ - public static function humanFileSize( $bytes ) { - return(\OC_Helper::humanFileSize( $bytes )); + public static function humanFileSize($bytes) { + return(\OC_Helper::humanFileSize($bytes)); } /** @@ -458,8 +458,8 @@ public static function humanFileSize( $bytes ) { * Inspired by: http://www.php.net/manual/en/function.filesize.php#92418 * @since 4.0.0 */ - public static function computerFileSize( $str ) { - return(\OC_Helper::computerFileSize( $str )); + public static function computerFileSize($str) { + return(\OC_Helper::computerFileSize($str)); } /** @@ -476,8 +476,8 @@ public static function computerFileSize( $str ) { * TODO: write example * @since 4.0.0 */ - static public function connectHook($signalClass, $signalName, $slotClass, $slotName ) { - return(\OC_Hook::connect($signalClass, $signalName, $slotClass, $slotName )); + static public function connectHook($signalClass, $signalName, $slotClass, $slotName) { + return(\OC_Hook::connect($signalClass, $signalName, $slotClass, $slotName)); } /** @@ -490,8 +490,8 @@ static public function connectHook($signalClass, $signalName, $slotClass, $slotN * TODO: write example * @since 4.0.0 */ - static public function emitHook( $signalclass, $signalname, $params = []) { - return(\OC_Hook::emit( $signalclass, $signalname, $params )); + static public function emitHook($signalclass, $signalname, $params = []) { + return(\OC_Hook::emit($signalclass, $signalname, $params)); } /** diff --git a/remote.php b/remote.php index 4ac5f5c17f5e..a9a859de0de0 100644 --- a/remote.php +++ b/remote.php @@ -70,7 +70,7 @@ function handleException($e) { $server->exec(); } else { $statusCode = OC_Response::STATUS_INTERNAL_SERVER_ERROR; - if ($e instanceof \OC\ServiceUnavailableException ) { + if ($e instanceof \OC\ServiceUnavailableException) { $statusCode = OC_Response::STATUS_SERVICE_UNAVAILABLE; } if ($e instanceof RemoteException) { diff --git a/settings/Panels/Personal/Profile.php b/settings/Panels/Personal/Profile.php index fe3640b4f4a7..45421f9c88cf 100644 --- a/settings/Panels/Personal/Profile.php +++ b/settings/Panels/Personal/Profile.php @@ -61,7 +61,7 @@ public function getPanel() { // Assign some data $lang = $this->lfactory->findLanguage(); - $userLang = $this->config->getUserValue( $this->userSession->getUser()->getUID(), 'core', 'lang', $lang); + $userLang = $this->config->getUserValue($this->userSession->getUser()->getUID(), 'core', 'lang', $lang); $languageCodes = $this->lfactory->findAvailableLanguages(); // array of common languages $commonLangCodes = [ @@ -100,7 +100,7 @@ public function getPanel() { } \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/settings/ajax/setlanguage.php b/settings/ajax/setlanguage.php index 645a3e91708a..b88ab3344f44 100644 --- a/settings/ajax/setlanguage.php +++ b/settings/ajax/setlanguage.php @@ -31,11 +31,11 @@ // Get data -if( isset( $_POST['lang'] ) ) { +if(isset($_POST['lang'])) { $languageCodes = \OC::$server->getL10NFactory()->findAvailableLanguages(); $lang = (string)$_POST['lang']; if(\array_search($lang, $languageCodes) or $lang === 'en') { - \OC::$server->getConfig()->setUserValue( OC_User::getUser(), 'core', 'lang', $lang ); + \OC::$server->getConfig()->setUserValue(OC_User::getUser(), 'core', 'lang', $lang); OC_JSON::success(["data" => ["message" => $l->t("Language changed")]]); }else{ OC_JSON::error(["data" => ["message" => $l->t("Invalid request")]]); diff --git a/settings/help.php b/settings/help.php index 6b6a12990dfe..3e521b1aeece 100644 --- a/settings/help.php +++ b/settings/help.php @@ -30,16 +30,16 @@ OC_Util::checkLoggedIn(); // Load the files we need -OC_Util::addStyle( "settings", "settings" ); +OC_Util::addStyle("settings", "settings"); \OC::$server->getNavigationManager()->setActiveEntry('help'); if(isset($_GET['mode']) and $_GET['mode'] === 'admin') { - $url=\OCP\Util::linkToAbsolute( 'core', 'doc/admin/index.html' ); + $url=\OCP\Util::linkToAbsolute('core', 'doc/admin/index.html'); $style1=''; $style2=' active'; }else{ - $url=\OCP\Util::linkToAbsolute( 'core', 'doc/user/index.html' ); + $url=\OCP\Util::linkToAbsolute('core', 'doc/user/index.html'); $style1=' active'; $style2=''; } @@ -47,11 +47,11 @@ $url1=\OC::$server->getURLGenerator()->linkToRoute('settings_help').'?mode=user'; $url2=\OC::$server->getURLGenerator()->linkToRoute('settings_help').'?mode=admin'; -$tmpl = new OC_Template( "settings", "help", "user" ); -$tmpl->assign( "admin", OC_User::isAdminUser(OC_User::getUser())); -$tmpl->assign( "url", $url ); -$tmpl->assign( "url1", $url1 ); -$tmpl->assign( "url2", $url2 ); -$tmpl->assign( "style1", $style1 ); -$tmpl->assign( "style2", $style2 ); +$tmpl = new OC_Template("settings", "help", "user"); +$tmpl->assign("admin", OC_User::isAdminUser(OC_User::getUser())); +$tmpl->assign("url", $url); +$tmpl->assign("url1", $url1); +$tmpl->assign("url2", $url2); +$tmpl->assign("style1", $style1); +$tmpl->assign("style2", $style2); $tmpl->printPage(); diff --git a/settings/templates/panels/admin/filesharing.php b/settings/templates/panels/admin/filesharing.php index edd47e8b5cef..e895329522fb 100644 --- a/settings/templates/panels/admin/filesharing.php +++ b/settings/templates/panels/admin/filesharing.php @@ -49,10 +49,10 @@

- t( 'Expire after ' )); ?> + t('Expire after ')); ?> ' /> - t( 'days' )); ?> + t('days')); ?> />
diff --git a/settings/templates/panels/admin/logging.php b/settings/templates/panels/admin/logging.php index c6da6302ecda..115034d6f134 100644 --- a/settings/templates/panels/admin/logging.php +++ b/settings/templates/panels/admin/logging.php @@ -5,11 +5,11 @@ * @var OC_Defaults $theme */ $levelLabels = [ - $l->t( 'Everything (fatal issues, errors, warnings, info, debug)' ), - $l->t( 'Info, warnings, errors and fatal issues' ), - $l->t( 'Warnings, errors and fatal issues' ), - $l->t( 'Errors and fatal issues' ), - $l->t( 'Fatal issues only' ), + $l->t('Everything (fatal issues, errors, warnings, info, debug)'), + $l->t('Info, warnings, errors and fatal issues'), + $l->t('Warnings, errors and fatal issues'), + $l->t('Errors and fatal issues'), + $l->t('Fatal issues only'), ]; ?> diff --git a/settings/templates/panels/admin/mail.php b/settings/templates/panels/admin/mail.php index 9b1ea23109d8..22cb3c25939b 100644 --- a/settings/templates/panels/admin/mail.php +++ b/settings/templates/panels/admin/mail.php @@ -38,7 +38,7 @@

t('This is used for sending out notifications.')); ?>

- + > @@ -66,7 +66,7 @@

- + ' />@

diff --git a/settings/templates/panels/admin/securitywarning.php b/settings/templates/panels/admin/securitywarning.php index e286552f5102..490ac7a741d4 100644 --- a/settings/templates/panels/admin/securitywarning.php +++ b/settings/templates/panels/admin/securitywarning.php @@ -108,7 +108,7 @@
  • t('SQLite is used as database. For larger installations we recommend to switch to a different database backend.')); ?>
    t('Especially when using the desktop client for file syncing the use of SQLite is discouraged.')); ?>
    - t('To migrate to another database use the command line tool: \'occ db:convert-type\', or see the documentation ↗.', link_to_docs('admin-db-conversion') )); ?> + t('To migrate to another database use the command line tool: \'occ db:convert-type\', or see the documentation ↗.', link_to_docs('admin-db-conversion'))); ?>
  • isDir() ? \rmdir($file) : \unlink($file); } } @@ -996,7 +996,7 @@ public static function removeFilesFromLocalStorageAfter() { $dir = "./work/local_storage/"; $di = new RecursiveDirectoryIterator($dir, FilesystemIterator::SKIP_DOTS); $ri = new RecursiveIteratorIterator($di, RecursiveIteratorIterator::CHILD_FIRST); - foreach ( $ri as $file ) { + foreach ($ri as $file) { $file->isDir() ? \rmdir($file) : \unlink($file); } } diff --git a/tests/acceptance/features/bootstrap/Provisioning.php b/tests/acceptance/features/bootstrap/Provisioning.php index 6a50caac1f37..a4ba6d08ae46 100644 --- a/tests/acceptance/features/bootstrap/Provisioning.php +++ b/tests/acceptance/features/bootstrap/Provisioning.php @@ -185,7 +185,7 @@ public function theGroupShouldBeAbleToBeDeleted($groupname) { * @return void */ public function adminCreatesUserUsingTheAPI($user) { - if (!$this->userExists($user) ) { + if (!$this->userExists($user)) { $password = $this->getPasswordForUser($user); $this->createUser($user, $password, null, null, true, 'api'); } diff --git a/tests/acceptance/features/bootstrap/Tags.php b/tests/acceptance/features/bootstrap/Tags.php index 448019104665..87932018fa88 100644 --- a/tests/acceptance/features/bootstrap/Tags.php +++ b/tests/acceptance/features/bootstrap/Tags.php @@ -385,7 +385,7 @@ private function tag($taggingUser, $tagName, $fileName, $fileOwner) { $this->getPasswordForUser($taggingUser), $tagName, $fileName, $fileOwner, $this->getDavPathVersion('systemtags') ); - } catch ( BadResponseException $e ) { + } catch (BadResponseException $e) { $this->response = $e->getResponse(); } } diff --git a/tests/acceptance/features/bootstrap/Trashbin.php b/tests/acceptance/features/bootstrap/Trashbin.php index 87e6ae7fd7e4..b0f0e19115f1 100644 --- a/tests/acceptance/features/bootstrap/Trashbin.php +++ b/tests/acceptance/features/bootstrap/Trashbin.php @@ -126,7 +126,7 @@ private function isInTrash($user, $originalPath) { $found = false; foreach ($listing as $entry) { - if (\substr($entry['extraData'], 0, 2) === "./" ) { + if (\substr($entry['extraData'], 0, 2) === "./") { $entry['extraData'] = \substr($entry['extraData'], 2); } if ($entry['extraData'] === $originalPath) { @@ -164,7 +164,7 @@ private function restoreElement($user, $originalPath) { $originalPath = \trim($originalPath, '/'); foreach ($listing as $entry) { - if (\substr($entry['extraData'], 0, 2) === "./" ) { + if (\substr($entry['extraData'], 0, 2) === "./") { $entry['extraData'] = \substr($entry['extraData'], 2); } if ($entry['extraData'] === $originalPath) { diff --git a/tests/acceptance/features/bootstrap/WebDav.php b/tests/acceptance/features/bootstrap/WebDav.php index c9f1f5c3368a..a0fb71ddc0af 100644 --- a/tests/acceptance/features/bootstrap/WebDav.php +++ b/tests/acceptance/features/bootstrap/WebDav.php @@ -1765,7 +1765,7 @@ private function getFileIdForPath($user, $path) { $this->getPasswordForUser($user), $path ); - } catch ( Exception $e ) { + } catch (Exception $e) { return null; } } diff --git a/tests/lib/App/DependencyAnalyzerTest.php b/tests/lib/App/DependencyAnalyzerTest.php index ebe69267c41c..e0da947f8db7 100644 --- a/tests/lib/App/DependencyAnalyzerTest.php +++ b/tests/lib/App/DependencyAnalyzerTest.php @@ -31,24 +31,24 @@ public function setUp() { ->getMock(); $this->platformMock->expects($this->any()) ->method('getPhpVersion') - ->will( $this->returnValue('5.4.3')); + ->will($this->returnValue('5.4.3')); $this->platformMock->expects($this->any()) ->method('getIntSize') - ->will( $this->returnValue('4')); + ->will($this->returnValue('4')); $this->platformMock->expects($this->any()) ->method('getDatabase') - ->will( $this->returnValue('mysql')); + ->will($this->returnValue('mysql')); $this->platformMock->expects($this->any()) ->method('getOS') - ->will( $this->returnValue('Linux')); + ->will($this->returnValue('Linux')); $this->platformMock->expects($this->any()) ->method('isCommandKnown') - ->will( $this->returnCallback(function($command) { + ->will($this->returnCallback(function($command) { return ($command === 'grep'); })); $this->platformMock->expects($this->any()) ->method('getLibraryVersion') - ->will( $this->returnCallback(function($lib) { + ->will($this->returnCallback(function($lib) { if ($lib === 'curl') { return "2.3.4"; } @@ -56,7 +56,7 @@ public function setUp() { })); $this->platformMock->expects($this->any()) ->method('getOcVersion') - ->will( $this->returnValue('8.0.2')); + ->will($this->returnValue('8.0.2')); $this->l10nMock = $this->getMockBuilder('\OCP\IL10N') ->disableOriginalConstructor() diff --git a/tests/lib/AvatarTest.php b/tests/lib/AvatarTest.php index bbca3059f83a..e5804edae5df 100644 --- a/tests/lib/AvatarTest.php +++ b/tests/lib/AvatarTest.php @@ -32,7 +32,7 @@ public function setUp() { } public function testGetNoAvatar() { - $this->assertFalse( $this->avatar->get()); + $this->assertFalse($this->avatar->get()); } public function testGetAvatarSizeMatch() { diff --git a/tests/lib/ContactsManagerTest.php b/tests/lib/ContactsManagerTest.php index dbab1f434ac2..466d1a0a8458 100644 --- a/tests/lib/ContactsManagerTest.php +++ b/tests/lib/ContactsManagerTest.php @@ -60,7 +60,7 @@ public function searchProvider(){ /** * @dataProvider searchProvider */ - public function testSearch($search1, $search2, $expectedResult ){ + public function testSearch($search1, $search2, $expectedResult){ $addressbook1 = $this->getMockBuilder('\OCP\IAddressBook') ->disableOriginalConstructor() ->getMock(); diff --git a/tests/lib/DB/DBSchemaTest.php b/tests/lib/DB/DBSchemaTest.php index 59f4bcafec7c..55fb5e5e7f9d 100644 --- a/tests/lib/DB/DBSchemaTest.php +++ b/tests/lib/DB/DBSchemaTest.php @@ -32,12 +32,12 @@ protected function setUp() { $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 d76e3278e79d..6ef25c49c86c 100644 --- a/tests/lib/DB/LegacyDBTest.php +++ b/tests/lib/DB/LegacyDBTest.php @@ -57,9 +57,9 @@ protected function setUp() { $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 f898255d69f6..6afbb59614db 100644 --- a/tests/lib/DB/SchemaDiffTest.php +++ b/tests/lib/DB/SchemaDiffTest.php @@ -68,7 +68,7 @@ protected function tearDown() { */ public function testZeroChangeOnSchemaMigrations($xml) { - $xml = \str_replace( '*dbprefix*', $this->testPrefix, $xml ); + $xml = \str_replace('*dbprefix*', $this->testPrefix, $xml); $schemaFile = 'static://test_db_scheme'; \file_put_contents($schemaFile, $xml); diff --git a/tests/lib/TestCase.php b/tests/lib/TestCase.php index 3dbb6001f20b..65a7fa0727b6 100644 --- a/tests/lib/TestCase.php +++ b/tests/lib/TestCase.php @@ -514,7 +514,7 @@ private function removeWhitespaces(DOMNode $domNode) { if($node->hasChildNodes()) { $this->removeWhitespaces($node); } else { - if ($node instanceof \DOMText && $node->isWhitespaceInElementContent() ) { + if ($node instanceof \DOMText && $node->isWhitespaceInElementContent()) { $domNode->removeChild($node); } } diff --git a/tests/lib/User/SessionTest.php b/tests/lib/User/SessionTest.php index d8506e691a19..e3868c7f581a 100644 --- a/tests/lib/User/SessionTest.php +++ b/tests/lib/User/SessionTest.php @@ -1149,7 +1149,7 @@ public function testVerifyAuthHeaders($expectedReturn, array $modules, $loggedIn $session->expects($this->any())->method('getUser')->willReturn($loggedInUser); $session->expects($expectedReturn ? $this->never() : $this->once())->method('logout'); - $this->assertEquals( $expectedReturn, $session->verifyAuthHeaders($request)); + $this->assertEquals($expectedReturn, $session->verifyAuthHeaders($request)); } public function providesModulesForLogin() { @@ -1201,6 +1201,6 @@ public function testTryAuthModuleLogin($expectedReturn, array $modules) { $session->expects($expectedReturn ? $this->once() : $this->never())->method('loginUser')->willReturn($expectedReturn); } - $this->assertEquals( $expectedReturn, $session->tryAuthModuleLogin($request)); + $this->assertEquals($expectedReturn, $session->tryAuthModuleLogin($request)); } } diff --git a/tests/lib/User/Sync/AllUsersIteratorTest.php b/tests/lib/User/Sync/AllUsersIteratorTest.php index ebb3ae7711a2..7381d3bbb7d6 100644 --- a/tests/lib/User/Sync/AllUsersIteratorTest.php +++ b/tests/lib/User/Sync/AllUsersIteratorTest.php @@ -77,11 +77,11 @@ public function testNext() { // create pages for 1001 users (0..1000) $page1 = []; - for ( $i=0; $i<500; $i++ ) { + for ($i=0; $i<500; $i++) { $page1[] = "user$i"; } $page2 = []; - for ( $i=500; $i<1000; $i++ ) { + for ($i=500; $i<1000; $i++) { $page2[] = "user$i"; } $page3 = ['user1000']; @@ -111,7 +111,7 @@ public function testNext() { $this->assertTrue($this->iterator->valid()); $this->assertEquals('user0', $this->iterator->current()); $this->assertEquals(0, $this->iterator->key()); - for ( $i=1; $i<=1000; $i++ ) { + for ($i=1; $i<=1000; $i++) { $this->iterator->next(); $this->assertTrue($this->iterator->valid()); $this->assertEquals("user$i", $this->iterator->current()); diff --git a/tests/lib/User/Sync/SeenUsersIteratorTest.php b/tests/lib/User/Sync/SeenUsersIteratorTest.php index caf8da1f0889..225adc67555a 100644 --- a/tests/lib/User/Sync/SeenUsersIteratorTest.php +++ b/tests/lib/User/Sync/SeenUsersIteratorTest.php @@ -81,11 +81,11 @@ public function testNext() { // create pages for 1001 users (0..1000) $page1 = []; - for ( $i=0; $i<500; $i++ ) { + for ($i=0; $i<500; $i++) { $page1[] = "user$i"; } $page2 = []; - for ( $i=500; $i<1000; $i++ ) { + for ($i=500; $i<1000; $i++) { $page2[] = "user$i"; } $page3 = ['user1000']; @@ -118,7 +118,7 @@ public function testNext() { $this->assertTrue($this->iterator->valid()); $this->assertEquals('user0', $this->iterator->current()); $this->assertEquals(0, $this->iterator->key()); - for ( $i=1; $i<=1000; $i++ ) { + for ($i=1; $i<=1000; $i++) { $this->iterator->next(); $this->assertTrue($this->iterator->valid()); $this->assertEquals("user$i", $this->iterator->current()); diff --git a/tests/lib/User/UserTest.php b/tests/lib/User/UserTest.php index bc02672f4879..ba45e8e16640 100644 --- a/tests/lib/User/UserTest.php +++ b/tests/lib/User/UserTest.php @@ -447,7 +447,7 @@ public function testSetEnabledHook(){ ->with( $this->callback( function($eventName){ - if ($eventName === User::class . '::postSetEnabled' ){ + if ($eventName === User::class . '::postSetEnabled'){ return true; } return false; From 8d6c0603948b3bee14c9e98c534876e0c4e4a19c Mon Sep 17 00:00:00 2001 From: Phil Davis Date: Thu, 26 Apr 2018 13:21:10 +0545 Subject: [PATCH 5/8] php-cs-fixer: add no_extra_consecutive_blank_lines --- .php_cs | 1 + 1 file changed, 1 insertion(+) diff --git a/.php_cs b/.php_cs index 14247cb5269b..2117b17229ab 100644 --- a/.php_cs +++ b/.php_cs @@ -46,6 +46,7 @@ return PhpCsFixer\Config::create() 'combine_consecutive_issets' => true, 'combine_consecutive_unsets' => true, 'no_spaces_inside_parenthesis' => true, + 'no_extra_consecutive_blank_lines' => true, ]) ->setFinder($finder) ; \ No newline at end of file From d97d0f4047f1ef7295c0f2e597cc54ffaccd5f7c Mon Sep 17 00:00:00 2001 From: Phil Davis Date: Thu, 26 Apr 2018 13:23:44 +0545 Subject: [PATCH 6/8] Applying new php-cs-fixer rule: no_extra_consecutive_blank_lines --- apps/comments/lib/Dav/CommentNode.php | 1 - apps/comments/lib/Dav/CommentsPlugin.php | 2 -- .../tests/unit/Dav/CommentsPluginTest.php | 2 -- .../Migrations/Version20170202213905.php | 1 - apps/dav/lib/Avatars/AvatarHome.php | 3 --- apps/dav/lib/Avatars/AvatarNode.php | 2 -- apps/dav/lib/CalDAV/CalendarObject.php | 2 -- apps/dav/lib/CalDAV/Schedule/Plugin.php | 2 -- apps/dav/lib/Capabilities.php | 1 - apps/dav/lib/CardDAV/SyncService.php | 1 - apps/dav/lib/Connector/Sabre/Auth.php | 1 - apps/dav/lib/Connector/Sabre/File.php | 2 -- .../lib/Connector/Sabre/MaintenancePlugin.php | 1 - apps/dav/lib/Connector/Sabre/Node.php | 1 - apps/dav/lib/DAV/CopyPlugin.php | 1 - apps/dav/lib/Files/ICopySource.php | 2 -- apps/dav/lib/Files/IFileNode.php | 2 -- .../lib/Files/IProvidesAdditionalHeaders.php | 2 -- apps/dav/lib/Meta/MetaFile.php | 2 -- apps/dav/lib/Meta/MetaFolder.php | 2 -- apps/dav/lib/Meta/RootCollection.php | 2 -- apps/dav/lib/SystemTag/SystemTagPlugin.php | 1 - .../SystemTagsObjectMappingCollection.php | 1 - apps/dav/lib/Upload/AssemblyStream.php | 1 - apps/dav/lib/Upload/ChunkLocationProvider.php | 2 -- apps/dav/lib/Upload/ChunkingPlugin.php | 2 -- apps/dav/lib/Upload/ChunkingPluginZsync.php | 1 - .../tests/unit/AppInfo/PluginManagerTest.php | 1 - .../dav/tests/unit/Avatars/AvatarHomeTest.php | 2 -- .../dav/tests/unit/Avatars/AvatarNodeTest.php | 2 -- .../unit/CalDAV/PublicCalendarRootTest.php | 1 - .../unit/CalDAV/Publishing/PublisherTest.php | 1 - .../unit/CardDAV/AddressBookImplTest.php | 2 -- .../tests/unit/CardDAV/CardDavBackendTest.php | 1 - .../unit/CardDAV/ImageExportPluginTest.php | 2 -- .../tests/unit/CardDAV/Sharing/PluginTest.php | 1 - .../tests/unit/Command/CleanupChunksTest.php | 2 -- .../tests/unit/Connector/PublicAuthTest.php | 1 - .../Sabre/CommentsPropertiesPluginTest.php | 1 - .../unit/Connector/Sabre/CorsPluginTest.php | 1 - .../unit/Connector/Sabre/DirectoryTest.php | 1 - .../Sabre/DummyGetResponsePluginTest.php | 1 - .../tests/unit/Connector/Sabre/FileTest.php | 3 --- .../Connector/Sabre/FilesReportPluginTest.php | 2 -- .../unit/Connector/Sabre/ObjectTreeTest.php | 3 --- apps/dav/tests/unit/DAV/CopyPluginTest.php | 2 -- .../DAV/FileCustomPropertiesBackendTest.php | 1 - .../DAV/MiscCustomPropertiesBackendTest.php | 2 -- .../dav/tests/unit/DAV/Sharing/PluginTest.php | 1 - .../unit/DAV/SystemPrincipalBackendTest.php | 1 - apps/dav/tests/unit/DAV/ZsyncPluginTest.php | 2 -- .../unit/Repair/RemoveInvalidSharesTest.php | 2 -- .../SystemTagsByIdCollectionTest.php | 1 - .../SystemTagsObjectMappingCollectionTest.php | 1 - apps/dav/tests/unit/TreeTest.php | 2 -- .../tests/unit/Upload/ChunkingPluginTest.php | 3 --- .../unit/Upload/ChunkingPluginZsyncTest.php | 1 - .../lib/BackgroundJob/RetryJob.php | 2 -- .../lib/FederatedShareProvider.php | 4 ---- .../lib/Notifications.php | 1 - apps/federatedfilesharing/lib/Notifier.php | 1 - .../lib/RequestHandler.php | 1 - .../federatedfilesharing/lib/TokenHandler.php | 2 -- .../tests/AddressHandlerTest.php | 2 -- .../tests/FederatedShareProviderTest.php | 5 ---- .../tests/NotificationsTest.php | 4 ---- .../tests/RequestHandlerTest.php | 1 - .../tests/TokenHandlerTest.php | 2 -- .../lib/BackgroundJob/GetSharedSecret.php | 1 - .../lib/BackgroundJob/RequestSharedSecret.php | 3 --- .../lib/Controller/SettingsController.php | 2 -- apps/federation/lib/DbHandler.php | 2 -- apps/federation/lib/Hooks.php | 3 --- apps/federation/lib/TrustedServers.php | 1 - apps/federation/tests/API/OCSAuthAPITest.php | 2 -- .../BackgroundJob/GetSharedSecretTest.php | 2 -- .../BackgroundJob/RequestSharedSecretTest.php | 2 -- .../Controller/SettingsControllerTest.php | 2 -- apps/federation/tests/DAV/FedAuthTest.php | 1 - apps/federation/tests/DbHandlerTest.php | 3 --- apps/federation/tests/HooksTest.php | 2 -- .../Middleware/AddServerMiddlewareTest.php | 2 -- apps/federation/tests/TrustedServersTest.php | 3 --- apps/files/lib/App.php | 1 - apps/files/lib/Command/Scan.php | 1 - apps/files/lib/Command/VerifyChecksums.php | 5 ---- .../tests/Command/VerifyChecksumsTest.php | 11 --------- apps/files_external/appinfo/routes.php | 1 - .../Controller/GlobalStoragesController.php | 2 -- .../lib/Controller/StoragesController.php | 1 - .../lib/Controller/UserStoragesController.php | 1 - apps/files_sharing/ajax/shareinfo.php | 1 - apps/files_sharing/lib/API/Share20OCS.php | 2 -- .../lib/Controller/ShareesController.php | 2 -- apps/files_sharing/lib/External/Manager.php | 1 - apps/files_sharing/lib/Helper.php | 1 - apps/files_sharing/lib/Migration.php | 2 -- apps/files_sharing/lib/MountProvider.php | 1 - apps/files_sharing/lib/SharedMount.php | 2 -- apps/files_sharing/lib/Updater.php | 1 - .../tests/API/Share20OCSTest.php | 6 ----- apps/files_sharing/tests/ApiTest.php | 5 ---- apps/files_sharing/tests/BackendTest.php | 1 - .../tests/Controllers/ShareControllerTest.php | 3 --- .../tests/External/ManagerTest.php | 1 - .../Middleware/SharingCheckMiddlewareTest.php | 2 -- apps/files_sharing/tests/MigrationTest.php | 1 - apps/files_sharing/tests/PermissionsTest.php | 1 - apps/files_sharing/tests/SharedMountTest.php | 3 --- .../files_sharing/tests/SharedStorageTest.php | 6 ----- apps/files_trashbin/ajax/isEmpty.php | 1 - apps/files_trashbin/lib/Quota.php | 1 - apps/files_trashbin/lib/Trashbin.php | 2 -- apps/files_trashbin/list.php | 1 - .../tests/Command/CleanUpTest.php | 2 -- .../tests/Command/ExpireTrashTest.php | 1 - apps/files_trashbin/tests/ExpirationTest.php | 4 ---- apps/files_trashbin/tests/StorageTest.php | 1 - apps/files_trashbin/tests/TrashbinTest.php | 4 ---- apps/files_versions/lib/Command/CleanUp.php | 3 --- apps/files_versions/lib/Command/Expire.php | 1 - apps/files_versions/lib/Expiration.php | 1 - apps/files_versions/lib/Hooks.php | 1 - apps/files_versions/lib/Storage.php | 2 -- .../tests/Command/CleanupTest.php | 5 ---- .../tests/Command/ExpireVersionsTest.php | 1 - apps/files_versions/tests/ExpirationTest.php | 2 -- apps/files_versions/tests/VersioningTest.php | 1 - apps/provisioning_api/tests/AppsTest.php | 1 - apps/provisioning_api/tests/UsersTest.php | 4 ---- .../testing/locking/fakedblockingprovider.php | 1 - .../lib/Notification/BackgroundJob.php | 2 -- .../lib/Notification/Notifier.php | 1 - .../tests/Controller/AdminControllerTest.php | 1 - .../tests/Notification/BackgroundJobTest.php | 1 - .../tests/Notification/NotifierTest.php | 1 - core/Command/Background/Base.php | 1 - core/Command/Db/ConvertType.php | 1 - core/Command/Db/Migrations/ExecuteCommand.php | 1 - .../Command/Db/Migrations/GenerateCommand.php | 1 - core/Command/Db/Migrations/MigrateCommand.php | 1 - core/Command/Db/Migrations/StatusCommand.php | 1 - .../Encryption/ChangeKeyStorageRoot.php | 4 ---- core/Command/Encryption/SetDefaultModule.php | 1 - .../Command/Encryption/ShowKeyStorageRoot.php | 1 - core/Command/Maintenance/DataFingerprint.php | 1 - core/Command/Upgrade.php | 1 - core/Command/User/SyncBackend.php | 2 -- core/Controller/LostController.php | 1 - core/Migrations/Version20170101010100.php | 2 -- core/Migrations/Version20170526104128.php | 1 - core/ajax/share.php | 1 - core/register_command.php | 1 - lib/base.php | 1 - lib/private/Activity/Manager.php | 1 - lib/private/AllConfig.php | 2 -- lib/private/App/CodeChecker/CodeChecker.php | 1 - lib/private/AppFramework/App.php | 3 --- lib/private/AppFramework/Core/API.php | 12 ---------- lib/private/AppFramework/Db/Db.php | 1 - .../DependencyInjection/DIContainer.php | 6 ----- lib/private/AppFramework/Http.php | 4 ---- lib/private/AppFramework/Http/Dispatcher.php | 4 ---- lib/private/AppFramework/Http/Request.php | 2 -- .../Middleware/MiddlewareDispatcher.php | 8 ------- .../Security/SecurityMiddleware.php | 2 -- .../Utility/ControllerMethodReflector.php | 7 ------ .../AppFramework/Utility/SimpleContainer.php | 3 --- .../AppFramework/Utility/TimeFactory.php | 4 ---- lib/private/Cache/CappedMemoryCache.php | 1 - lib/private/CapabilitiesManager.php | 1 - lib/private/Comments/Comment.php | 1 - lib/private/Console/TimestampFormatter.php | 1 - lib/private/DB/AdapterMySQL.php | 1 - lib/private/DB/AdapterOCI8.php | 1 - lib/private/DB/AdapterPgSql.php | 1 - lib/private/DB/AdapterSqlite.php | 1 - lib/private/DB/MigrationException.php | 1 - .../MySqlSchemaColumnDefinitionListener.php | 2 -- .../MySqlExpressionBuilder.php | 1 - .../OCIExpressionBuilder.php | 1 - .../PgSqlExpressionBuilder.php | 1 - lib/private/DateTimeZone.php | 1 - lib/private/Encryption/DecryptAll.php | 2 -- lib/private/Encryption/EncryptionWrapper.php | 2 -- .../Exceptions/DecryptionFailedException.php | 1 - .../EmptyEncryptionDataException.php | 1 - .../Exceptions/EncryptionFailedException.php | 1 - .../EncryptionHeaderToLargeException.php | 1 - .../Exceptions/UnknownCipherException.php | 1 - lib/private/Encryption/File.php | 3 --- lib/private/Encryption/Keys/Storage.php | 1 - lib/private/Encryption/Manager.php | 2 -- lib/private/Encryption/Util.php | 1 - lib/private/Files/Cache/Cache.php | 1 - lib/private/Files/Cache/CacheEntry.php | 4 ---- lib/private/Files/Cache/FailedCache.php | 1 - lib/private/Files/Cache/HomePropagator.php | 1 - lib/private/Files/Cache/Propagator.php | 2 -- lib/private/Files/Cache/Scanner.php | 1 - .../Files/External/Auth/NullMechanism.php | 1 - .../Files/External/DependencyTrait.php | 1 - .../Service/GlobalStoragesService.php | 1 - lib/private/Files/Meta/MetaFileIdNode.php | 1 - lib/private/Files/Meta/MetaRootNode.php | 2 -- .../Files/Meta/MetaVersionCollection.php | 2 -- lib/private/Files/Node/AbstractFile.php | 2 -- lib/private/Files/Node/AbstractFolder.php | 2 -- lib/private/Files/Node/AbstractNode.php | 1 - lib/private/Files/Node/LazyRoot.php | 1 - .../ObjectStore/HomeObjectStoreStorage.php | 1 - .../Files/ObjectStore/ObjectStoreStorage.php | 1 - lib/private/Files/Storage/Home.php | 1 - lib/private/Files/Storage/Local.php | 1 - lib/private/Files/Storage/Storage.php | 1 - lib/private/Files/Storage/Wrapper/DirMask.php | 1 - .../Files/Storage/Wrapper/Encryption.php | 1 - .../Files/Storage/Wrapper/ReadOnlyJail.php | 2 -- lib/private/Files/Storage/Wrapper/Wrapper.php | 1 - lib/private/Files/Stream/Checksum.php | 4 ---- lib/private/Files/Stream/Encryption.php | 1 - lib/private/Files/View.php | 3 --- lib/private/Http/Client/Client.php | 1 - lib/private/Installer.php | 1 - .../ExcludeFileByNameFilterIterator.php | 1 - lib/private/L10N/Factory.php | 1 - lib/private/L10N/L10NString.php | 1 - lib/private/Log.php | 1 - lib/private/Log/Errorlog.php | 1 - lib/private/Migration/ConsoleOutput.php | 2 -- lib/private/Migration/SimpleOutput.php | 2 -- lib/private/Notification/Action.php | 1 - lib/private/Notification/Notification.php | 1 - lib/private/Preview/Bitmap.php | 1 - lib/private/Repair/DisableExtraThemes.php | 1 - lib/private/Repair/DropOldJobs.php | 1 - lib/private/Repair/DropOldTables.php | 1 - lib/private/Repair/RepairInvalidShares.php | 1 - lib/private/Repair/RepairMimeTypes.php | 1 - .../Repair/RepairMismatchFileCachePath.php | 1 - lib/private/Route/Router.php | 1 - lib/private/Security/Crypto.php | 1 - lib/private/Security/Hasher.php | 1 - lib/private/Server.php | 3 --- lib/private/ServerContainer.php | 1 - lib/private/ServerNotAvailableException.php | 1 - lib/private/Settings/SettingsManager.php | 1 - lib/private/Share/Helper.php | 1 - lib/private/Share/Share.php | 6 ----- .../Share20/Exception/ProviderException.php | 1 - lib/private/Share20/Manager.php | 3 --- lib/private/SystemConfig.php | 1 - lib/private/Updater/VersionCheck.php | 1 - lib/private/User/Account.php | 1 - lib/private/User/AccountMapper.php | 1 - lib/private/User/AccountTerm.php | 1 - lib/private/User/AccountTermMapper.php | 1 - lib/private/User/BasicAuthModule.php | 3 --- lib/private/User/Manager.php | 1 - lib/private/User/RemoteUser.php | 2 -- lib/private/User/Session.php | 1 - lib/private/User/Sync/UsersIterator.php | 1 - lib/private/User/SyncService.php | 1 - lib/private/User/TokenAuthModule.php | 2 -- lib/private/legacy/filechunking.php | 1 - lib/private/legacy/files.php | 1 - lib/private/legacy/json.php | 1 - lib/private/legacy/template.php | 1 - lib/private/legacy/user.php | 2 -- lib/private/legacy/util.php | 4 ---- lib/public/Activity/IManager.php | 1 - lib/public/App/IServiceLoader.php | 1 - lib/public/AppFramework/ApiController.php | 3 --- lib/public/AppFramework/App.php | 3 --- lib/public/AppFramework/Controller.php | 12 ---------- .../AppFramework/Db/DoesNotExistException.php | 2 -- lib/public/AppFramework/Db/Entity.php | 12 ---------- lib/public/AppFramework/Db/Mapper.php | 13 ----------- .../Db/MultipleObjectsReturnedException.php | 2 -- .../AppFramework/Http/DataDisplayResponse.php | 3 --- lib/public/AppFramework/Http/DataResponse.php | 4 ---- .../AppFramework/Http/DownloadResponse.php | 3 --- .../Http/EmptyContentSecurityPolicy.php | 1 - .../AppFramework/Http/ICallbackResponse.php | 1 - lib/public/AppFramework/Http/IOutput.php | 1 - lib/public/AppFramework/Http/JSONResponse.php | 3 --- .../AppFramework/Http/RedirectResponse.php | 4 ---- lib/public/AppFramework/Http/Response.php | 17 -------------- .../AppFramework/Http/StreamResponse.php | 1 - .../AppFramework/Http/TemplateResponse.php | 7 ------ lib/public/AppFramework/IApi.php | 7 ------ lib/public/AppFramework/Middleware.php | 5 ---- lib/public/AppFramework/OCSController.php | 2 -- .../AppFramework/Utility/ITimeFactory.php | 2 -- lib/public/BackgroundJob.php | 1 - lib/public/Comments/IComment.php | 1 - .../DB/QueryBuilder/IExpressionBuilder.php | 1 - lib/public/DB/QueryBuilder/IQueryBuilder.php | 2 -- lib/public/Encryption/IManager.php | 1 - .../Files/External/Backend/InvalidBackend.php | 1 - .../External/IStoragesBackendService.php | 1 - lib/public/Files/IMimeTypeDetector.php | 1 - .../Files/IProvidesAdditionalHeaders.php | 2 -- lib/public/Files/IRootFolder.php | 1 - lib/public/Files/Node.php | 1 - .../ObjectStore/IVersionedObjectStorage.php | 1 - .../Files/Storage/IVersionedStorage.php | 1 - lib/public/Http/HttpEvents.php | 1 - lib/public/IConfig.php | 1 - lib/public/IContainer.php | 1 - lib/public/IDb.php | 4 ---- lib/public/IL10N.php | 1 - lib/public/IPreview.php | 1 - lib/public/IRequest.php | 4 ---- lib/public/ISearch.php | 1 - lib/public/IServerContainer.php | 1 - lib/public/ISession.php | 1 - lib/public/ISubAdminManager.php | 1 - lib/public/IURLGenerator.php | 1 - lib/public/IUserManager.php | 1 - lib/public/L10N/IFactory.php | 1 - lib/public/SabrePluginEvent.php | 1 - lib/public/SabrePluginException.php | 1 - lib/public/Security/StringUtils.php | 1 - lib/public/Share.php | 2 -- lib/public/Share/Events/ShareEvent.php | 1 - lib/public/Share/IManager.php | 1 - lib/public/Share/IShareProvider.php | 1 - lib/public/Template.php | 7 ------ lib/public/User/IChangePasswordBackend.php | 1 - .../User/IProvidesDisplayNameBackend.php | 1 - lib/public/User/IProvidesEMailBackend.php | 1 - .../User/IProvidesExtendedSearchBackend.php | 1 - lib/public/User/IProvidesHomeBackend.php | 1 - lib/public/User/IProvidesQuotaBackend.php | 1 - lib/public/Util/UserSearch.php | 1 - ocs/routes.php | 1 - .../Controller/AuthSettingsController.php | 1 - settings/Controller/CheckSetupController.php | 1 - settings/Panels/Personal/Cors.php | 1 - settings/ajax/setlanguage.php | 1 - settings/help.php | 1 - tests/Core/Command/Apps/AppsDisableTest.php | 2 -- tests/Core/Command/Apps/AppsEnableTest.php | 2 -- tests/Core/Command/Apps/AppsGetPathTest.php | 1 - tests/Core/Command/Apps/AppsListTest.php | 1 - tests/Core/Command/Apps/CheckCodeTest.php | 1 - .../Command/Config/App/DeleteConfigTest.php | 2 -- .../Core/Command/Config/App/GetConfigTest.php | 2 -- .../Core/Command/Config/App/SetConfigTest.php | 2 -- tests/Core/Command/Config/ImportTest.php | 1 - tests/Core/Command/Config/ListConfigsTest.php | 1 - .../Config/System/DeleteConfigTest.php | 1 - .../Command/Config/System/GetConfigTest.php | 2 -- .../Command/Config/System/SetConfigTest.php | 2 -- .../Encryption/ChangeKeyStorageRootTest.php | 4 ---- .../Command/Encryption/DecryptAllTest.php | 2 -- tests/Core/Command/Encryption/DisableTest.php | 2 -- tests/Core/Command/Encryption/EnableTest.php | 2 -- .../Command/Encryption/EncryptAllTest.php | 2 -- .../Encryption/SetDefaultModuleTest.php | 2 -- tests/Core/Command/Group/DeleteTest.php | 1 - tests/Core/Command/Log/ManageTest.php | 1 - tests/Core/Command/Log/OwnCloudTest.php | 1 - .../Maintenance/DataFingerprintTest.php | 1 - .../Command/Maintenance/SingleUserTest.php | 1 - tests/Core/Command/User/DeleteTest.php | 2 -- tests/Core/Command/User/LastSeenTest.php | 1 - tests/Core/Command/User/ListUsersTest.php | 1 - tests/Core/Command/User/SettingTest.php | 2 -- .../Core/Controller/AvatarControllerTest.php | 3 --- tests/Core/Controller/LostControllerTest.php | 2 -- .../Controller/CertificateControllerTest.php | 1 - .../Controller/CheckSetupControllerTest.php | 3 --- .../Controller/SettingsPageControllerTest.php | 1 - .../features/bootstrap/Trashbin.php | 1 - .../acceptance/features/bootstrap/WebDav.php | 4 ---- .../features/bootstrap/WebUIFilesContext.php | 1 - .../features/bootstrap/WebUILoginContext.php | 2 -- .../EditPublicLinkPopup.php | 1 - tests/lib/AppFramework/AppTest.php | 10 -------- .../Controller/ApiControllerTest.php | 3 --- .../Controller/ControllerTest.php | 22 ------------------ .../Controller/OCSControllerTest.php | 5 ---- tests/lib/AppFramework/Db/EntityTest.php | 23 ------------------- tests/lib/AppFramework/Db/MapperTest.php | 13 ----------- .../lib/AppFramework/Db/MapperTestUtility.php | 7 ------ .../DependencyInjection/DIContainerTest.php | 9 -------- .../Http/ContentSecurityPolicyTest.php | 1 - .../AppFramework/Http/DataResponseTest.php | 8 ------- .../lib/AppFramework/Http/DispatcherTest.php | 20 ---------------- .../Http/DownloadResponseTest.php | 5 ---- .../Http/EmptyContentSecurityPolicyTest.php | 1 - tests/lib/AppFramework/Http/HttpTest.php | 9 -------- .../AppFramework/Http/JSONResponseTest.php | 5 ---- .../lib/AppFramework/Http/OCSResponseTest.php | 7 ------ .../Http/RedirectResponseTest.php | 5 ---- tests/lib/AppFramework/Http/RequestTest.php | 3 --- tests/lib/AppFramework/Http/ResponseTest.php | 19 --------------- .../AppFramework/Http/StreamResponseTest.php | 3 --- .../Http/TemplateResponseTest.php | 3 --- .../Middleware/MiddlewareDispatcherTest.php | 15 ------------ .../Middleware/MiddlewareTest.php | 7 ------ .../Security/CORSMiddlewareTest.php | 5 ---- .../Security/SecurityMiddlewareTest.php | 15 ------------ .../Middleware/SessionMiddlewareTest.php | 2 -- .../lib/AppFramework/Routing/RoutingTest.php | 1 - .../Utility/ControllerMethodReflectorTest.php | 11 --------- .../Utility/SimpleContainerTest.php | 9 -------- tests/lib/AppTest.php | 1 - tests/lib/Archive/TARTest.php | 1 - tests/lib/Archive/TestBase.php | 1 - tests/lib/Archive/ZIPTest.php | 1 - tests/lib/BackgroundJob/TestJob.php | 1 - tests/lib/Command/AsyncBusTest.php | 2 -- tests/lib/Comments/CommentTest.php | 2 -- tests/lib/ContactsManagerTest.php | 3 --- tests/lib/DB/AdapterTest.php | 1 - tests/lib/DB/MigrationsTest.php | 1 - tests/lib/DB/MigratorTest.php | 1 - tests/lib/Encryption/DecryptAllTest.php | 5 ---- .../lib/Encryption/EncryptionWrapperTest.php | 3 --- tests/lib/Encryption/UpdateTest.php | 3 --- tests/lib/Files/Cache/CacheTest.php | 1 - .../External/Service/DBConfigServiceTest.php | 1 - .../Service/GlobalStoragesServiceTest.php | 1 - .../External/Service/StoragesServiceTest.php | 1 - tests/lib/Files/MetaFilesTest.php | 2 -- tests/lib/Files/Mount/MountTest.php | 1 - tests/lib/Files/Node/AbstractFileTest.php | 2 -- tests/lib/Files/Node/AbstractFolderTest.php | 2 -- tests/lib/Files/Node/AbstractNodeTest.php | 2 -- tests/lib/Files/Node/FolderTest.php | 1 - tests/lib/Files/Node/IntegrationTest.php | 1 - tests/lib/Files/Node/NodeTest.php | 4 ---- tests/lib/Files/ObjectStore/MapperTest.php | 1 - .../ObjectStore/ObjectStoreStorageTest.php | 1 - tests/lib/Files/PathVerificationTest.php | 1 - tests/lib/Files/Storage/Storage.php | 1 - .../Files/Storage/Wrapper/ChecksumTest.php | 5 ---- .../lib/Files/Storage/Wrapper/DirMaskTest.php | 4 ---- .../Files/Storage/Wrapper/EncryptionTest.php | 4 ---- .../Storage/Wrapper/ReadOnlyJailTest.php | 2 -- .../Files/Stream/DummyEncryptionWrapper.php | 1 - tests/lib/Files/Stream/EncryptionTest.php | 1 - tests/lib/Files/Type/DetectionTest.php | 7 ------ tests/lib/Files/Type/LoaderTest.php | 1 - tests/lib/Files/ViewTest.php | 2 -- tests/lib/Group/ManagerTest.php | 3 --- tests/lib/HTTPHelperTest.php | 2 -- tests/lib/HelperStorageTest.php | 1 - tests/lib/InstallerTest.php | 1 - tests/lib/IntegrityCheck/CheckerTest.php | 3 --- .../ExcludeFileByNameFilterIteratorTest.php | 1 - tests/lib/L10N/FactoryTest.php | 1 - tests/lib/L10N/L10nTest.php | 1 - tests/lib/LegacyHelperTest.php | 1 - tests/lib/Lock/LockingProvider.php | 1 - tests/lib/Log/OwncloudTest.php | 1 - tests/lib/Memcache/Cache.php | 1 - tests/lib/Migration/BackgroundRepairTest.php | 1 - tests/lib/Notification/ActionTest.php | 1 - tests/lib/Notification/NotificationTest.php | 1 - tests/lib/PublicNamespace/UtilTest.php | 1 - tests/lib/Repair/CleanTagsTest.php | 1 - tests/lib/Repair/RepairInvalidSharesTest.php | 1 - .../RepairMismatchFileCachePathTest.php | 3 --- .../lib/Repair/RepairOrphanedSubshareTest.php | 1 - tests/lib/Repair/RepairUnmergedSharesTest.php | 1 - tests/lib/Route/RouteTest.php | 1 - tests/lib/Route/RouterTest.php | 1 - .../CSP/ContentSecurityPolicyManagerTest.php | 1 - tests/lib/Security/HasherTest.php | 1 - tests/lib/ServerTest.php | 1 - tests/lib/Share/Backend.php | 2 -- tests/lib/Share/MailNotificationsTest.php | 1 - tests/lib/Share/ShareTest.php | 16 ------------- .../lib/Share20/DefaultShareProviderTest.php | 3 --- tests/lib/Share20/ManagerTest.php | 5 ---- tests/lib/Share20/ShareTest.php | 2 -- tests/lib/Template/BaseTest.php | 2 -- tests/lib/Template/CSSResourceLocatorTest.php | 1 - tests/lib/Template/JSResourceLocatorTest.php | 2 -- tests/lib/TestCase.php | 2 -- tests/lib/User/AccountMapperTest.php | 2 -- tests/lib/User/BasicAuthModuleTest.php | 3 --- tests/lib/User/ManagerTest.php | 1 - tests/lib/User/SessionTest.php | 2 -- tests/lib/User/Sync/AllUsersIteratorTest.php | 1 - tests/lib/User/Sync/SeenUsersIteratorTest.php | 1 - tests/lib/User/TokenAuthModuleTest.php | 2 -- tests/lib/Util/User/MemoryAccountMapper.php | 1 - tests/lib/UtilTest.php | 1 - tests/lib/legacy/AppTest.php | 2 -- 494 files changed, 1124 deletions(-) diff --git a/apps/comments/lib/Dav/CommentNode.php b/apps/comments/lib/Dav/CommentNode.php index 697224b41692..eac9f954cb16 100644 --- a/apps/comments/lib/Dav/CommentNode.php +++ b/apps/comments/lib/Dav/CommentNode.php @@ -22,7 +22,6 @@ namespace OCA\Comments\Dav; - use OCP\Comments\IComment; use OCP\Comments\ICommentsManager; use OCP\Comments\MessageTooLongException; diff --git a/apps/comments/lib/Dav/CommentsPlugin.php b/apps/comments/lib/Dav/CommentsPlugin.php index 7639662c8511..8261215e2a35 100644 --- a/apps/comments/lib/Dav/CommentsPlugin.php +++ b/apps/comments/lib/Dav/CommentsPlugin.php @@ -254,6 +254,4 @@ private function createComment($objectType, $objectId, $data, $contentType = 'ap } } - - } diff --git a/apps/comments/tests/unit/Dav/CommentsPluginTest.php b/apps/comments/tests/unit/Dav/CommentsPluginTest.php index 7ae7916c342d..3cf39f6a3e6c 100644 --- a/apps/comments/tests/unit/Dav/CommentsPluginTest.php +++ b/apps/comments/tests/unit/Dav/CommentsPluginTest.php @@ -738,6 +738,4 @@ public function testOnReport() { $this->plugin->onReport(CommentsPluginImplementation::REPORT_NAME, $parameters, '/' . $path); } - - } diff --git a/apps/dav/appinfo/Migrations/Version20170202213905.php b/apps/dav/appinfo/Migrations/Version20170202213905.php index 5cbc822366b6..5fbd8ea60897 100644 --- a/apps/dav/appinfo/Migrations/Version20170202213905.php +++ b/apps/dav/appinfo/Migrations/Version20170202213905.php @@ -28,7 +28,6 @@ use OCP\IUserManager; use OCP\Migration\ISqlMigration; - /* * Resolve userid/propertypath into fileid * Update all entries with actual fileid if possible diff --git a/apps/dav/lib/Avatars/AvatarHome.php b/apps/dav/lib/Avatars/AvatarHome.php index e87abac1c2cf..371e978318ff 100644 --- a/apps/dav/lib/Avatars/AvatarHome.php +++ b/apps/dav/lib/Avatars/AvatarHome.php @@ -19,10 +19,8 @@ * */ - namespace OCA\DAV\Avatars; - use OCP\IAvatarManager; use Sabre\DAV\Exception\Forbidden; use Sabre\DAV\Exception\MethodNotAllowed; @@ -115,5 +113,4 @@ function getLastModified() { return null; } - } diff --git a/apps/dav/lib/Avatars/AvatarNode.php b/apps/dav/lib/Avatars/AvatarNode.php index a8aa92af3403..f280fa293bf3 100644 --- a/apps/dav/lib/Avatars/AvatarNode.php +++ b/apps/dav/lib/Avatars/AvatarNode.php @@ -19,10 +19,8 @@ * */ - namespace OCA\DAV\Avatars; - use OCP\IAvatar; use Sabre\DAV\File; diff --git a/apps/dav/lib/CalDAV/CalendarObject.php b/apps/dav/lib/CalDAV/CalendarObject.php index 90501e64a02b..67b3e8e95f8a 100644 --- a/apps/dav/lib/CalDAV/CalendarObject.php +++ b/apps/dav/lib/CalDAV/CalendarObject.php @@ -19,10 +19,8 @@ * */ - namespace OCA\DAV\CalDAV; - use Sabre\VObject\Component; use Sabre\VObject\Property; use Sabre\VObject\Reader; diff --git a/apps/dav/lib/CalDAV/Schedule/Plugin.php b/apps/dav/lib/CalDAV/Schedule/Plugin.php index 6c746085f9de..dc7ce7165b5b 100644 --- a/apps/dav/lib/CalDAV/Schedule/Plugin.php +++ b/apps/dav/lib/CalDAV/Schedule/Plugin.php @@ -19,10 +19,8 @@ * */ - namespace OCA\DAV\CalDAV\Schedule; - class Plugin extends \Sabre\CalDAV\Schedule\Plugin { public function getAddressesForPrincipal($principal) { diff --git a/apps/dav/lib/Capabilities.php b/apps/dav/lib/Capabilities.php index a63ada4f4501..2548ae6dd53f 100644 --- a/apps/dav/lib/Capabilities.php +++ b/apps/dav/lib/Capabilities.php @@ -19,7 +19,6 @@ * */ - namespace OCA\DAV; use OCP\Capabilities\ICapability; diff --git a/apps/dav/lib/CardDAV/SyncService.php b/apps/dav/lib/CardDAV/SyncService.php index ce4cc964d0da..3c471b9e1d58 100644 --- a/apps/dav/lib/CardDAV/SyncService.php +++ b/apps/dav/lib/CardDAV/SyncService.php @@ -280,5 +280,4 @@ public function syncInstance(\Closure $progressCallback = null) { } } - } diff --git a/apps/dav/lib/Connector/Sabre/Auth.php b/apps/dav/lib/Connector/Sabre/Auth.php index 916b026a8587..68e1454d036d 100644 --- a/apps/dav/lib/Connector/Sabre/Auth.php +++ b/apps/dav/lib/Connector/Sabre/Auth.php @@ -46,7 +46,6 @@ class Auth extends AbstractBasic { - const DAV_AUTHENTICATED = 'AUTHENTICATED_TO_DAV_BACKEND'; /** @var ISession */ diff --git a/apps/dav/lib/Connector/Sabre/File.php b/apps/dav/lib/Connector/Sabre/File.php index 6383dd82b6d5..1676935cc86e 100644 --- a/apps/dav/lib/Connector/Sabre/File.php +++ b/apps/dav/lib/Connector/Sabre/File.php @@ -500,7 +500,6 @@ private function createFileChunked($data) { /** @var \OC\Files\Storage\Storage $targetStorage */ list($partStorage, $partInternalPath) = $this->fileView->resolvePath($partFile); - $chunk_handler->file_assemble($partStorage, $partInternalPath); if (!self::isChecksumValid($partStorage, $partInternalPath)) { @@ -547,7 +546,6 @@ private function createFileChunked($data) { // FIXME: should call refreshInfo but can't because $this->path is not the of the final file $info = $this->fileView->getFileInfo($targetPath); - if (isset($partStorage, $partInternalPath)) { $checksums = $partStorage->getMetaData($partInternalPath)['checksum']; } else { diff --git a/apps/dav/lib/Connector/Sabre/MaintenancePlugin.php b/apps/dav/lib/Connector/Sabre/MaintenancePlugin.php index 22a840fa5004..c6e0c2000fb7 100644 --- a/apps/dav/lib/Connector/Sabre/MaintenancePlugin.php +++ b/apps/dav/lib/Connector/Sabre/MaintenancePlugin.php @@ -51,7 +51,6 @@ public function __construct(IConfig $config = null) { } } - /** * This initializes the plugin. * diff --git a/apps/dav/lib/Connector/Sabre/Node.php b/apps/dav/lib/Connector/Sabre/Node.php index 6123a8ad7d72..a6a674d17885 100644 --- a/apps/dav/lib/Connector/Sabre/Node.php +++ b/apps/dav/lib/Connector/Sabre/Node.php @@ -41,7 +41,6 @@ use OCP\Share\Exceptions\ShareNotFound; use OCP\Share\IManager; - abstract class Node implements \Sabre\DAV\INode { /** diff --git a/apps/dav/lib/DAV/CopyPlugin.php b/apps/dav/lib/DAV/CopyPlugin.php index c5c944647e05..00c41c12bda2 100644 --- a/apps/dav/lib/DAV/CopyPlugin.php +++ b/apps/dav/lib/DAV/CopyPlugin.php @@ -19,7 +19,6 @@ * */ - namespace OCA\DAV\DAV; use OCA\DAV\Connector\Sabre\Exception\Forbidden; diff --git a/apps/dav/lib/Files/ICopySource.php b/apps/dav/lib/Files/ICopySource.php index a8b5c48620d7..45c9480de8f5 100644 --- a/apps/dav/lib/Files/ICopySource.php +++ b/apps/dav/lib/Files/ICopySource.php @@ -19,10 +19,8 @@ * */ - namespace OCA\DAV\Files; - /** * Interface ICopySource * This interface allows special handling of copy operations based on the copy source. diff --git a/apps/dav/lib/Files/IFileNode.php b/apps/dav/lib/Files/IFileNode.php index 588dfcbd6d55..98157aa36616 100644 --- a/apps/dav/lib/Files/IFileNode.php +++ b/apps/dav/lib/Files/IFileNode.php @@ -19,10 +19,8 @@ * */ - namespace OCA\DAV\Files; - use OCP\Files\Node; interface IFileNode { diff --git a/apps/dav/lib/Files/IProvidesAdditionalHeaders.php b/apps/dav/lib/Files/IProvidesAdditionalHeaders.php index 44f44c2e1d71..7e4676e37845 100644 --- a/apps/dav/lib/Files/IProvidesAdditionalHeaders.php +++ b/apps/dav/lib/Files/IProvidesAdditionalHeaders.php @@ -19,10 +19,8 @@ * */ - namespace OCA\DAV\Files; - /** * Interface IProvidesAdditionalHeaders * This interface allows to add additional headers to the response diff --git a/apps/dav/lib/Meta/MetaFile.php b/apps/dav/lib/Meta/MetaFile.php index 2ea78c515d3c..3a5c86f97168 100644 --- a/apps/dav/lib/Meta/MetaFile.php +++ b/apps/dav/lib/Meta/MetaFile.php @@ -19,10 +19,8 @@ * */ - namespace OCA\DAV\Meta; - use OC\Files\Meta\MetaFileVersionNode; use OCA\DAV\Files\ICopySource; use OCA\DAV\Files\IProvidesAdditionalHeaders; diff --git a/apps/dav/lib/Meta/MetaFolder.php b/apps/dav/lib/Meta/MetaFolder.php index 00bea8cddc37..46b6430aca9e 100644 --- a/apps/dav/lib/Meta/MetaFolder.php +++ b/apps/dav/lib/Meta/MetaFolder.php @@ -19,10 +19,8 @@ * */ - namespace OCA\DAV\Meta; - use OCP\Files\File; use OCP\Files\Folder; use OCP\Files\Node; diff --git a/apps/dav/lib/Meta/RootCollection.php b/apps/dav/lib/Meta/RootCollection.php index bb762146af16..cd328871486b 100644 --- a/apps/dav/lib/Meta/RootCollection.php +++ b/apps/dav/lib/Meta/RootCollection.php @@ -19,10 +19,8 @@ * */ - namespace OCA\DAV\Meta; - use OC\Files\Meta\MetaFileIdNode; use OCP\Files\IRootFolder; use OCP\Files\NotFoundException; diff --git a/apps/dav/lib/SystemTag/SystemTagPlugin.php b/apps/dav/lib/SystemTag/SystemTagPlugin.php index 1b600f5afec5..695b4f421678 100644 --- a/apps/dav/lib/SystemTag/SystemTagPlugin.php +++ b/apps/dav/lib/SystemTag/SystemTagPlugin.php @@ -207,7 +207,6 @@ private function createTag($data, $contentType = 'application/json') { } } - /** * Retrieves system tag properties * diff --git a/apps/dav/lib/SystemTag/SystemTagsObjectMappingCollection.php b/apps/dav/lib/SystemTag/SystemTagsObjectMappingCollection.php index 03c7f15b5c66..792f6b1f393a 100644 --- a/apps/dav/lib/SystemTag/SystemTagsObjectMappingCollection.php +++ b/apps/dav/lib/SystemTag/SystemTagsObjectMappingCollection.php @@ -64,7 +64,6 @@ class SystemTagsObjectMappingCollection implements ICollection { */ private $user; - /** * Constructor * diff --git a/apps/dav/lib/Upload/AssemblyStream.php b/apps/dav/lib/Upload/AssemblyStream.php index df4a122c19ef..4a398a0291a6 100644 --- a/apps/dav/lib/Upload/AssemblyStream.php +++ b/apps/dav/lib/Upload/AssemblyStream.php @@ -207,7 +207,6 @@ public function stream_close() { return true; } - /** * Load the source from the stream context and return the context options * diff --git a/apps/dav/lib/Upload/ChunkLocationProvider.php b/apps/dav/lib/Upload/ChunkLocationProvider.php index 3986ab878aa3..e06e947557fb 100644 --- a/apps/dav/lib/Upload/ChunkLocationProvider.php +++ b/apps/dav/lib/Upload/ChunkLocationProvider.php @@ -19,10 +19,8 @@ * */ - namespace OCA\DAV\Upload; - use OC\Files\Mount\MountPoint; use OC\Files\Storage\Local; use OCP\Files\Config\IMountProvider; diff --git a/apps/dav/lib/Upload/ChunkingPlugin.php b/apps/dav/lib/Upload/ChunkingPlugin.php index 969afb47a7a9..5c515edd0863 100644 --- a/apps/dav/lib/Upload/ChunkingPlugin.php +++ b/apps/dav/lib/Upload/ChunkingPlugin.php @@ -19,10 +19,8 @@ * */ - namespace OCA\DAV\Upload; - use Sabre\DAV\Exception\BadRequest; use Sabre\DAV\Server; use Sabre\DAV\ServerPlugin; diff --git a/apps/dav/lib/Upload/ChunkingPluginZsync.php b/apps/dav/lib/Upload/ChunkingPluginZsync.php index 15009e595668..7f1d9835b4a1 100644 --- a/apps/dav/lib/Upload/ChunkingPluginZsync.php +++ b/apps/dav/lib/Upload/ChunkingPluginZsync.php @@ -18,7 +18,6 @@ */ namespace OCA\DAV\Upload; - use OCA\DAV\Connector\Sabre\File; use Sabre\DAV\Exception\BadRequest; use Sabre\DAV\Server; diff --git a/apps/dav/tests/unit/AppInfo/PluginManagerTest.php b/apps/dav/tests/unit/AppInfo/PluginManagerTest.php index 9c7f5b604caa..6811ba4941f2 100644 --- a/apps/dav/tests/unit/AppInfo/PluginManagerTest.php +++ b/apps/dav/tests/unit/AppInfo/PluginManagerTest.php @@ -35,7 +35,6 @@ class PluginManagerTest extends TestCase { public function test() { $server = $this->createMock(ServerContainer::class); - $appManager = $this->createMock(IAppManager::class); $appManager->method('getInstalledApps') ->willReturn(['adavapp', 'adavapp2']); diff --git a/apps/dav/tests/unit/Avatars/AvatarHomeTest.php b/apps/dav/tests/unit/Avatars/AvatarHomeTest.php index 38d9aa0255f1..753b01dad032 100644 --- a/apps/dav/tests/unit/Avatars/AvatarHomeTest.php +++ b/apps/dav/tests/unit/Avatars/AvatarHomeTest.php @@ -19,10 +19,8 @@ * */ - namespace OCA\DAV\Tests\Unit\Avatars; - use OCA\DAV\Avatars\AvatarHome; use OCA\DAV\Avatars\AvatarNode; use OCP\IAvatar; diff --git a/apps/dav/tests/unit/Avatars/AvatarNodeTest.php b/apps/dav/tests/unit/Avatars/AvatarNodeTest.php index c50a6d4b5d37..e19a5dee1a12 100644 --- a/apps/dav/tests/unit/Avatars/AvatarNodeTest.php +++ b/apps/dav/tests/unit/Avatars/AvatarNodeTest.php @@ -19,10 +19,8 @@ * */ - namespace OCA\DAV\Tests\Unit\Avatars; - use OCA\DAV\Avatars\AvatarNode; use OCP\IAvatar; use OCP\IImage; diff --git a/apps/dav/tests/unit/CalDAV/PublicCalendarRootTest.php b/apps/dav/tests/unit/CalDAV/PublicCalendarRootTest.php index 4c091db3afac..9c1388c504d1 100644 --- a/apps/dav/tests/unit/CalDAV/PublicCalendarRootTest.php +++ b/apps/dav/tests/unit/CalDAV/PublicCalendarRootTest.php @@ -145,5 +145,4 @@ protected function createPublicCalendar() { return $calendar; } - } diff --git a/apps/dav/tests/unit/CalDAV/Publishing/PublisherTest.php b/apps/dav/tests/unit/CalDAV/Publishing/PublisherTest.php index 5bb03172c2fc..fbd52f686120 100644 --- a/apps/dav/tests/unit/CalDAV/Publishing/PublisherTest.php +++ b/apps/dav/tests/unit/CalDAV/Publishing/PublisherTest.php @@ -58,7 +58,6 @@ public function testSerializeNotPublished() { urltopublish', $xml); } - protected $elementMap = []; protected $namespaceMap = ['DAV:' => 'd']; protected $contextUri = '/'; diff --git a/apps/dav/tests/unit/CardDAV/AddressBookImplTest.php b/apps/dav/tests/unit/CardDAV/AddressBookImplTest.php index a41d25dfa5d9..00c01d5efb5d 100644 --- a/apps/dav/tests/unit/CardDAV/AddressBookImplTest.php +++ b/apps/dav/tests/unit/CardDAV/AddressBookImplTest.php @@ -22,10 +22,8 @@ * */ - namespace OCA\DAV\Tests\unit\CardDAV; - use OCA\DAV\CardDAV\AddressBook; use OCA\DAV\CardDAV\AddressBookImpl; use OCA\DAV\CardDAV\CardDavBackend; diff --git a/apps/dav/tests/unit/CardDAV/CardDavBackendTest.php b/apps/dav/tests/unit/CardDAV/CardDavBackendTest.php index c4d2ffceaf4e..4d9427287f8e 100644 --- a/apps/dav/tests/unit/CardDAV/CardDavBackendTest.php +++ b/apps/dav/tests/unit/CardDAV/CardDavBackendTest.php @@ -89,7 +89,6 @@ public function setUp() { $query = $this->db->getQueryBuilder(); $query->delete('cards')->execute(); - $this->tearDown(); } diff --git a/apps/dav/tests/unit/CardDAV/ImageExportPluginTest.php b/apps/dav/tests/unit/CardDAV/ImageExportPluginTest.php index 778713015248..4c5424b1faf2 100644 --- a/apps/dav/tests/unit/CardDAV/ImageExportPluginTest.php +++ b/apps/dav/tests/unit/CardDAV/ImageExportPluginTest.php @@ -20,10 +20,8 @@ * */ - namespace OCA\DAV\Tests\unit\CardDAV; - use OCA\DAV\CardDAV\ImageExportPlugin; use OCP\ILogger; use Sabre\CardDAV\Card; diff --git a/apps/dav/tests/unit/CardDAV/Sharing/PluginTest.php b/apps/dav/tests/unit/CardDAV/Sharing/PluginTest.php index 03648bd93832..0778fe3b940a 100644 --- a/apps/dav/tests/unit/CardDAV/Sharing/PluginTest.php +++ b/apps/dav/tests/unit/CardDAV/Sharing/PluginTest.php @@ -22,7 +22,6 @@ namespace OCA\DAV\Tests\unit\CardDAV\Sharing; - use OCA\DAV\Connector\Sabre\Auth; use OCA\DAV\DAV\Sharing\IShareable; use OCA\DAV\DAV\Sharing\Plugin; diff --git a/apps/dav/tests/unit/Command/CleanupChunksTest.php b/apps/dav/tests/unit/Command/CleanupChunksTest.php index aadf13c4e223..225ebcef82c1 100644 --- a/apps/dav/tests/unit/Command/CleanupChunksTest.php +++ b/apps/dav/tests/unit/Command/CleanupChunksTest.php @@ -19,10 +19,8 @@ * */ - namespace OCA\DAV\Tests\Unit\Command; - use OC\Files\View; use OCA\DAV\Command\CleanupChunks; use OCP\IUser; diff --git a/apps/dav/tests/unit/Connector/PublicAuthTest.php b/apps/dav/tests/unit/Connector/PublicAuthTest.php index f4a9e828d8e7..cab51178c502 100644 --- a/apps/dav/tests/unit/Connector/PublicAuthTest.php +++ b/apps/dav/tests/unit/Connector/PublicAuthTest.php @@ -113,7 +113,6 @@ public function testSharePasswordFancyShareType() { $this->assertFalse($result); } - public function testSharePasswordRemote() { $share = $this->createMock('OCP\Share\IShare'); $share->method('getPassword')->willReturn('password'); diff --git a/apps/dav/tests/unit/Connector/Sabre/CommentsPropertiesPluginTest.php b/apps/dav/tests/unit/Connector/Sabre/CommentsPropertiesPluginTest.php index 4b94edae3593..675623d95375 100644 --- a/apps/dav/tests/unit/Connector/Sabre/CommentsPropertiesPluginTest.php +++ b/apps/dav/tests/unit/Connector/Sabre/CommentsPropertiesPluginTest.php @@ -201,7 +201,6 @@ public function testHandleGetPropertiesUserLoggedOut() { $this->assertEquals(0, $result[200][CommentPropertiesPluginImplementation::PROPERTY_NAME_UNREAD]); } - public function nodeProvider() { $mocks = []; foreach(['\OCA\DAV\Connector\Sabre\File', '\OCA\DAV\Connector\Sabre\Directory', '\Sabre\DAV\INode'] as $class) { diff --git a/apps/dav/tests/unit/Connector/Sabre/CorsPluginTest.php b/apps/dav/tests/unit/Connector/Sabre/CorsPluginTest.php index 09cd5b4d4f1f..5496e0b9b5dd 100644 --- a/apps/dav/tests/unit/Connector/Sabre/CorsPluginTest.php +++ b/apps/dav/tests/unit/Connector/Sabre/CorsPluginTest.php @@ -132,7 +132,6 @@ public function optionsCases() { 'MOVE', ]; - return [ 'OPTIONS headers' => [ diff --git a/apps/dav/tests/unit/Connector/Sabre/DirectoryTest.php b/apps/dav/tests/unit/Connector/Sabre/DirectoryTest.php index 554e69d6b6ed..24ff2d3cba75 100644 --- a/apps/dav/tests/unit/Connector/Sabre/DirectoryTest.php +++ b/apps/dav/tests/unit/Connector/Sabre/DirectoryTest.php @@ -62,7 +62,6 @@ public function getRelativePath($path) { } } - /** * @group DB */ diff --git a/apps/dav/tests/unit/Connector/Sabre/DummyGetResponsePluginTest.php b/apps/dav/tests/unit/Connector/Sabre/DummyGetResponsePluginTest.php index ddbd865a2e96..df5403bc595d 100644 --- a/apps/dav/tests/unit/Connector/Sabre/DummyGetResponsePluginTest.php +++ b/apps/dav/tests/unit/Connector/Sabre/DummyGetResponsePluginTest.php @@ -52,7 +52,6 @@ public function testInitialize() { $this->dummyGetResponsePlugin->initialize($server); } - public function testHttpGet() { /** @var \Sabre\HTTP\RequestInterface $request */ $request = $this->createMock('\Sabre\HTTP\RequestInterface'); diff --git a/apps/dav/tests/unit/Connector/Sabre/FileTest.php b/apps/dav/tests/unit/Connector/Sabre/FileTest.php index b9ccab6ead59..d16fcc223058 100644 --- a/apps/dav/tests/unit/Connector/Sabre/FileTest.php +++ b/apps/dav/tests/unit/Connector/Sabre/FileTest.php @@ -73,8 +73,6 @@ public function setUp() { parent::setUp(); unset($_SERVER['HTTP_OC_CHUNKED'], $_SERVER['CONTENT_LENGTH'], $_SERVER['REQUEST_METHOD']); - - \OC_Hook::clear(); $this->user = $this->getUniqueID('user_'); @@ -117,7 +115,6 @@ private function getStream($string) { return $stream; } - public function fopenFailuresProvider() { return [ [ diff --git a/apps/dav/tests/unit/Connector/Sabre/FilesReportPluginTest.php b/apps/dav/tests/unit/Connector/Sabre/FilesReportPluginTest.php index e3c50c805461..9ab1d71a1caf 100644 --- a/apps/dav/tests/unit/Connector/Sabre/FilesReportPluginTest.php +++ b/apps/dav/tests/unit/Connector/Sabre/FilesReportPluginTest.php @@ -403,7 +403,6 @@ public function testFindNodesByFileIdsSubDir() { ->method('getPath') ->will($this->returnValue('/sub1/sub2')); - $subNode = $this->getMockBuilder('\OCP\Files\Folder') ->disableOriginalConstructor() ->getMock(); @@ -470,7 +469,6 @@ public function testProcessFilterRulesAndCondition() { ['456', 'files', 0, '', ['222', '333']], ]); - $rules = [ 'systemtag' => ['123', '456'], 'favorite' => null diff --git a/apps/dav/tests/unit/Connector/Sabre/ObjectTreeTest.php b/apps/dav/tests/unit/Connector/Sabre/ObjectTreeTest.php index d8d6027525c3..fb0b43f762c6 100644 --- a/apps/dav/tests/unit/Connector/Sabre/ObjectTreeTest.php +++ b/apps/dav/tests/unit/Connector/Sabre/ObjectTreeTest.php @@ -25,7 +25,6 @@ namespace OCA\DAV\Tests\unit\Connector\Sabre; - use OC\Files\FileInfo; use OC\Files\Filesystem; use OC\Files\Storage\Temporary; @@ -252,7 +251,6 @@ function nodeForPathProvider() { public function testGetNodeForPathInvalidPath() { $path = '/foo\bar'; - $storage = new Temporary([]); $view = $this->getMockBuilder(View::class) @@ -278,7 +276,6 @@ public function testGetNodeForPathInvalidPath() { public function testGetNodeForPathRoot() { $path = '/'; - $storage = new Temporary([]); $view = $this->createMock('\OC\Files\View', ['resolvePath']); diff --git a/apps/dav/tests/unit/DAV/CopyPluginTest.php b/apps/dav/tests/unit/DAV/CopyPluginTest.php index 66bb9f8d5962..e80f1b8b603b 100644 --- a/apps/dav/tests/unit/DAV/CopyPluginTest.php +++ b/apps/dav/tests/unit/DAV/CopyPluginTest.php @@ -19,10 +19,8 @@ * */ - namespace OCA\DAV\Tests\unit\DAV; - use OCA\DAV\Connector\Sabre\Directory; use OCA\DAV\Connector\Sabre\File; use OCA\DAV\DAV\CopyPlugin; diff --git a/apps/dav/tests/unit/DAV/FileCustomPropertiesBackendTest.php b/apps/dav/tests/unit/DAV/FileCustomPropertiesBackendTest.php index 50bb264176ee..444b391eab50 100644 --- a/apps/dav/tests/unit/DAV/FileCustomPropertiesBackendTest.php +++ b/apps/dav/tests/unit/DAV/FileCustomPropertiesBackendTest.php @@ -142,7 +142,6 @@ private function applyDefaultProps($path = '/dummypath') { $this->assertEquals(200, $result['customprop2']); } - /** * Test getting properties when node has no fileId * Should fail gracefully with no error diff --git a/apps/dav/tests/unit/DAV/MiscCustomPropertiesBackendTest.php b/apps/dav/tests/unit/DAV/MiscCustomPropertiesBackendTest.php index b28b304b8470..42e25c92f1fc 100644 --- a/apps/dav/tests/unit/DAV/MiscCustomPropertiesBackendTest.php +++ b/apps/dav/tests/unit/DAV/MiscCustomPropertiesBackendTest.php @@ -79,7 +79,6 @@ public function setUp() { $this->user ); - $connection = \OC::$server->getDatabaseConnection(); $qb = $connection->getQueryBuilder(); $maxFunction = $qb->createFunction( @@ -175,7 +174,6 @@ public function testSetGetPropertiesForCalendar() { $this->assertEquals(['unsetprop'], $propFind->get404Properties()); } - /** * Test delete property */ diff --git a/apps/dav/tests/unit/DAV/Sharing/PluginTest.php b/apps/dav/tests/unit/DAV/Sharing/PluginTest.php index b4be17c19ceb..97e1191cdf4a 100644 --- a/apps/dav/tests/unit/DAV/Sharing/PluginTest.php +++ b/apps/dav/tests/unit/DAV/Sharing/PluginTest.php @@ -22,7 +22,6 @@ namespace OCA\DAV\Tests\unit\DAV\Sharing; - use OCA\DAV\Connector\Sabre\Auth; use OCA\DAV\DAV\Sharing\IShareable; use OCA\DAV\DAV\Sharing\Plugin; diff --git a/apps/dav/tests/unit/DAV/SystemPrincipalBackendTest.php b/apps/dav/tests/unit/DAV/SystemPrincipalBackendTest.php index a275b581f550..900a7971949c 100644 --- a/apps/dav/tests/unit/DAV/SystemPrincipalBackendTest.php +++ b/apps/dav/tests/unit/DAV/SystemPrincipalBackendTest.php @@ -134,5 +134,4 @@ public function testGetGroupMembership() { $this->assertEquals([], $result); } - } diff --git a/apps/dav/tests/unit/DAV/ZsyncPluginTest.php b/apps/dav/tests/unit/DAV/ZsyncPluginTest.php index ffc00c051121..1857167664d0 100644 --- a/apps/dav/tests/unit/DAV/ZsyncPluginTest.php +++ b/apps/dav/tests/unit/DAV/ZsyncPluginTest.php @@ -75,7 +75,6 @@ public function providesQueryParams() { ]; } - public function testShowRouteWithExistsFile() { $this->view->expects($this->any())->method('file_exists')->willReturn(true); @@ -95,7 +94,6 @@ public function testShowRouteWithExistsFile() { $this->assertFalse($this->plugin->httpDelete($this->request, $this->response)); } - public function testShowRouteWithMissingBaseFile() { $this->view->expects($this->any())->method('file_exists')->willReturn(false); diff --git a/apps/dav/tests/unit/Repair/RemoveInvalidSharesTest.php b/apps/dav/tests/unit/Repair/RemoveInvalidSharesTest.php index 70ee6970392c..8c7676f53fe9 100644 --- a/apps/dav/tests/unit/Repair/RemoveInvalidSharesTest.php +++ b/apps/dav/tests/unit/Repair/RemoveInvalidSharesTest.php @@ -19,10 +19,8 @@ * */ - namespace OCA\DAV\Tests\Unit\Repair; - use OCA\DAV\Connector\Sabre\Principal; use OCA\DAV\Repair\RemoveInvalidShares; use OCP\Migration\IOutput; diff --git a/apps/dav/tests/unit/SystemTag/SystemTagsByIdCollectionTest.php b/apps/dav/tests/unit/SystemTag/SystemTagsByIdCollectionTest.php index 3a95db5ffb5e..a89eaf5a0acd 100644 --- a/apps/dav/tests/unit/SystemTag/SystemTagsByIdCollectionTest.php +++ b/apps/dav/tests/unit/SystemTag/SystemTagsByIdCollectionTest.php @@ -23,7 +23,6 @@ namespace OCA\DAV\Tests\unit\SystemTag; - use OC\SystemTag\SystemTag; use OCP\SystemTag\TagNotFoundException; diff --git a/apps/dav/tests/unit/SystemTag/SystemTagsObjectMappingCollectionTest.php b/apps/dav/tests/unit/SystemTag/SystemTagsObjectMappingCollectionTest.php index a5a9faae17c1..19fa06d58e33 100644 --- a/apps/dav/tests/unit/SystemTag/SystemTagsObjectMappingCollectionTest.php +++ b/apps/dav/tests/unit/SystemTag/SystemTagsObjectMappingCollectionTest.php @@ -23,7 +23,6 @@ namespace OCA\DAV\Tests\unit\SystemTag; - use OC\SystemTag\SystemTag; use OCP\SystemTag\TagNotFoundException; diff --git a/apps/dav/tests/unit/TreeTest.php b/apps/dav/tests/unit/TreeTest.php index 6d02ea2da482..35febfcc932a 100644 --- a/apps/dav/tests/unit/TreeTest.php +++ b/apps/dav/tests/unit/TreeTest.php @@ -19,10 +19,8 @@ * */ - namespace OCA\DAV\Tests\unit; - use OCA\DAV\Tree; use Sabre\DAV\ICollection; use Sabre\DAV\IFile; diff --git a/apps/dav/tests/unit/Upload/ChunkingPluginTest.php b/apps/dav/tests/unit/Upload/ChunkingPluginTest.php index 66b176bee359..ced5aee6655a 100644 --- a/apps/dav/tests/unit/Upload/ChunkingPluginTest.php +++ b/apps/dav/tests/unit/Upload/ChunkingPluginTest.php @@ -19,10 +19,8 @@ * */ - namespace OCA\DAV\Tests\unit\Upload; - use OCA\DAV\Connector\Sabre\Directory; use OCA\DAV\Upload\ChunkingPlugin; use OCA\DAV\Upload\FutureFile; @@ -32,7 +30,6 @@ class ChunkingPluginTest extends TestCase { - /** * @var \Sabre\DAV\Server | \PHPUnit_Framework_MockObject_MockObject */ diff --git a/apps/dav/tests/unit/Upload/ChunkingPluginZsyncTest.php b/apps/dav/tests/unit/Upload/ChunkingPluginZsyncTest.php index 7e134ae6b233..0c87fbdf9541 100644 --- a/apps/dav/tests/unit/Upload/ChunkingPluginZsyncTest.php +++ b/apps/dav/tests/unit/Upload/ChunkingPluginZsyncTest.php @@ -18,7 +18,6 @@ */ namespace OCA\DAV\Tests\unit\Upload; - use OCA\DAV\Upload\ChunkingPluginZsync; use Sabre\HTTP\RequestInterface; use Sabre\HTTP\ResponseInterface; diff --git a/apps/federatedfilesharing/lib/BackgroundJob/RetryJob.php b/apps/federatedfilesharing/lib/BackgroundJob/RetryJob.php index af36f76ff764..43b714322e5d 100644 --- a/apps/federatedfilesharing/lib/BackgroundJob/RetryJob.php +++ b/apps/federatedfilesharing/lib/BackgroundJob/RetryJob.php @@ -19,10 +19,8 @@ * */ - namespace OCA\FederatedFileSharing\BackgroundJob; - use OC\BackgroundJob\Job; use OC\BackgroundJob\JobList; use OCA\FederatedFileSharing\AddressHandler; diff --git a/apps/federatedfilesharing/lib/FederatedShareProvider.php b/apps/federatedfilesharing/lib/FederatedShareProvider.php index 77daa81df136..4adc78e1c21b 100644 --- a/apps/federatedfilesharing/lib/FederatedShareProvider.php +++ b/apps/federatedfilesharing/lib/FederatedShareProvider.php @@ -149,7 +149,6 @@ public function create(IShare $share) { throw new \Exception($message_t); } - // don't allow federated shares if source and target server are the same list($user, $remote) = $this->addressHandler->splitUserRemote($shareWith); $currentServer = $this->addressHandler->generateRemoteURL(); @@ -379,7 +378,6 @@ protected function sendPermissionUpdate(IShare $share) { $this->notifications->sendPermissionChange($remote, $remoteId, $share->getToken(), $share->getPermissions()); } - /** * update successful reShare with the correct token * @@ -725,7 +723,6 @@ public function getSharesByPath(Node $path) { return $shares; } - /** * @inheritdoc */ @@ -769,7 +766,6 @@ public function getSharedWith($userId, $shareType, $node, $limit, $offset) { } $cursor->closeCursor(); - return $shares; } diff --git a/apps/federatedfilesharing/lib/Notifications.php b/apps/federatedfilesharing/lib/Notifications.php index d54cb1cfda33..3e063000e144 100644 --- a/apps/federatedfilesharing/lib/Notifications.php +++ b/apps/federatedfilesharing/lib/Notifications.php @@ -23,7 +23,6 @@ * */ - namespace OCA\FederatedFileSharing; use OCP\AppFramework\Http; diff --git a/apps/federatedfilesharing/lib/Notifier.php b/apps/federatedfilesharing/lib/Notifier.php index 03f1b34fb13a..744ab65d0e93 100644 --- a/apps/federatedfilesharing/lib/Notifier.php +++ b/apps/federatedfilesharing/lib/Notifier.php @@ -22,7 +22,6 @@ namespace OCA\FederatedFileSharing; - use OCP\Notification\INotification; use OCP\Notification\INotifier; diff --git a/apps/federatedfilesharing/lib/RequestHandler.php b/apps/federatedfilesharing/lib/RequestHandler.php index f84eb05e5956..03a32a501dcb 100644 --- a/apps/federatedfilesharing/lib/RequestHandler.php +++ b/apps/federatedfilesharing/lib/RequestHandler.php @@ -443,7 +443,6 @@ private function cleanupRemote($remote) { return \rtrim($remote, '/'); } - /** * federated share was revoked, either by the owner or the re-sharer * diff --git a/apps/federatedfilesharing/lib/TokenHandler.php b/apps/federatedfilesharing/lib/TokenHandler.php index d62ea7e46779..81eb3c2acaa5 100644 --- a/apps/federatedfilesharing/lib/TokenHandler.php +++ b/apps/federatedfilesharing/lib/TokenHandler.php @@ -19,10 +19,8 @@ * */ - namespace OCA\FederatedFileSharing; - use OCP\Security\ISecureRandom; /** diff --git a/apps/federatedfilesharing/tests/AddressHandlerTest.php b/apps/federatedfilesharing/tests/AddressHandlerTest.php index 83bfea5f5693..f86b51548a73 100644 --- a/apps/federatedfilesharing/tests/AddressHandlerTest.php +++ b/apps/federatedfilesharing/tests/AddressHandlerTest.php @@ -21,10 +21,8 @@ * */ - namespace OCA\FederatedFileSharing\Tests; - use OCA\FederatedFileSharing\AddressHandler; use OCP\IL10N; use OCP\IURLGenerator; diff --git a/apps/federatedfilesharing/tests/FederatedShareProviderTest.php b/apps/federatedfilesharing/tests/FederatedShareProviderTest.php index 0cef557a9aa2..f4e5ffb35c9c 100644 --- a/apps/federatedfilesharing/tests/FederatedShareProviderTest.php +++ b/apps/federatedfilesharing/tests/FederatedShareProviderTest.php @@ -24,7 +24,6 @@ */ namespace OCA\FederatedFileSharing\Tests; - use OCA\FederatedFileSharing\AddressHandler; use OCA\FederatedFileSharing\FederatedShareProvider; use OCA\FederatedFileSharing\Notifications; @@ -69,7 +68,6 @@ class FederatedShareProviderTest extends \Test\TestCase { /** @var FederatedShareProvider */ protected $provider; - public function setUp() { parent::setUp(); @@ -344,7 +342,6 @@ public function testCreateAlreadyShared() { $node->method('getId')->willReturn(42); $node->method('getName')->willReturn('myFile'); - $this->addressHandler->expects($this->any())->method('splitUserRemote') ->willReturn(['user', 'server.com']); @@ -410,7 +407,6 @@ public function testUpdate($owner, $sharedBy) { $node->method('getId')->willReturn(42); $node->method('getName')->willReturn('myFile'); - $this->addressHandler->expects($this->any())->method('splitUserRemote') ->willReturn(['user', 'server.com']); @@ -467,7 +463,6 @@ public function testGetAllSharedWith() { $this->assertCount(0, $shares); } - public function testGetAllSharesByNodes() { $node = $this->createMock('\OCP\Files\File'); $node->method('getId')->willReturn(42); diff --git a/apps/federatedfilesharing/tests/NotificationsTest.php b/apps/federatedfilesharing/tests/NotificationsTest.php index e165fe438683..c301d4d68a22 100644 --- a/apps/federatedfilesharing/tests/NotificationsTest.php +++ b/apps/federatedfilesharing/tests/NotificationsTest.php @@ -20,10 +20,8 @@ * */ - namespace OCA\FederatedFileSharing\Tests; - use OCA\FederatedFileSharing\AddressHandler; use OCA\FederatedFileSharing\DiscoveryManager; use OCA\FederatedFileSharing\Notifications; @@ -93,7 +91,6 @@ private function getInstance(array $mockedMethods = []) { return $instance; } - /** * @dataProvider dataTestSendUpdateToRemote * @@ -142,7 +139,6 @@ public function testSendUpdateToRemote($try, $httpRequestResult, $expected) { } - public function dataTestSendUpdateToRemote() { return [ // test if background job is added correctly diff --git a/apps/federatedfilesharing/tests/RequestHandlerTest.php b/apps/federatedfilesharing/tests/RequestHandlerTest.php index ee1d3da4034b..fe6d0144c909 100644 --- a/apps/federatedfilesharing/tests/RequestHandlerTest.php +++ b/apps/federatedfilesharing/tests/RequestHandlerTest.php @@ -188,7 +188,6 @@ function testCreateShare() { $this->assertSame(0, (int)$data['accepted']); } - function testDeclineShare() { $this->s2s = $this->getMockBuilder('\OCA\FederatedFileSharing\RequestHandler') diff --git a/apps/federatedfilesharing/tests/TokenHandlerTest.php b/apps/federatedfilesharing/tests/TokenHandlerTest.php index fb9b52374dff..06a2cb9abe01 100644 --- a/apps/federatedfilesharing/tests/TokenHandlerTest.php +++ b/apps/federatedfilesharing/tests/TokenHandlerTest.php @@ -21,10 +21,8 @@ * */ - namespace OCA\FederatedFileSharing\Tests; - use OCA\FederatedFileSharing\TokenHandler; use OCP\Security\ISecureRandom; diff --git a/apps/federation/lib/BackgroundJob/GetSharedSecret.php b/apps/federation/lib/BackgroundJob/GetSharedSecret.php index 278c7c6ffd31..fddd59568b22 100644 --- a/apps/federation/lib/BackgroundJob/GetSharedSecret.php +++ b/apps/federation/lib/BackgroundJob/GetSharedSecret.php @@ -21,7 +21,6 @@ * */ - namespace OCA\Federation\BackgroundJob; use GuzzleHttp\Exception\ClientException; diff --git a/apps/federation/lib/BackgroundJob/RequestSharedSecret.php b/apps/federation/lib/BackgroundJob/RequestSharedSecret.php index e880f9624860..9eafdfddd9a3 100644 --- a/apps/federation/lib/BackgroundJob/RequestSharedSecret.php +++ b/apps/federation/lib/BackgroundJob/RequestSharedSecret.php @@ -22,10 +22,8 @@ * */ - namespace OCA\Federation\BackgroundJob; - use GuzzleHttp\Exception\ClientException; use OC\BackgroundJob\Job; use OC\BackgroundJob\JobList; @@ -105,7 +103,6 @@ public function __construct( } } - /** * run the job, then remove it from the joblist * diff --git a/apps/federation/lib/Controller/SettingsController.php b/apps/federation/lib/Controller/SettingsController.php index f9245714a1db..87e650954f9f 100644 --- a/apps/federation/lib/Controller/SettingsController.php +++ b/apps/federation/lib/Controller/SettingsController.php @@ -28,7 +28,6 @@ use OCP\IL10N; use OCP\IRequest; - class SettingsController extends Controller { /** @var IL10N */ @@ -53,7 +52,6 @@ public function __construct($AppName, $this->trustedServers = $trustedServers; } - /** * add server to the list of trusted ownClouds * diff --git a/apps/federation/lib/DbHandler.php b/apps/federation/lib/DbHandler.php index 409d1e4b6c2e..2b31a609aeab 100644 --- a/apps/federation/lib/DbHandler.php +++ b/apps/federation/lib/DbHandler.php @@ -20,10 +20,8 @@ * */ - namespace OCA\Federation; - use OC\Files\Filesystem; use OC\HintException; use OCP\IDBConnection; diff --git a/apps/federation/lib/Hooks.php b/apps/federation/lib/Hooks.php index 314f85504e4e..427210064772 100644 --- a/apps/federation/lib/Hooks.php +++ b/apps/federation/lib/Hooks.php @@ -19,11 +19,8 @@ * */ - namespace OCA\Federation; - - class Hooks { /** @var TrustedServers */ diff --git a/apps/federation/lib/TrustedServers.php b/apps/federation/lib/TrustedServers.php index 1e6a67dc5c9d..93281ea4eadd 100644 --- a/apps/federation/lib/TrustedServers.php +++ b/apps/federation/lib/TrustedServers.php @@ -22,7 +22,6 @@ * */ - namespace OCA\Federation; use OC\HintException; diff --git a/apps/federation/tests/API/OCSAuthAPITest.php b/apps/federation/tests/API/OCSAuthAPITest.php index 284e5da48d8c..e54dde744bfa 100644 --- a/apps/federation/tests/API/OCSAuthAPITest.php +++ b/apps/federation/tests/API/OCSAuthAPITest.php @@ -21,10 +21,8 @@ * */ - namespace OCA\Federation\Tests\API; - use OC\BackgroundJob\JobList; use OCA\Federation\Controller\OCSAuthAPIController; use OCA\Federation\DbHandler; diff --git a/apps/federation/tests/BackgroundJob/GetSharedSecretTest.php b/apps/federation/tests/BackgroundJob/GetSharedSecretTest.php index fe91b9994695..412d94d5ce2e 100644 --- a/apps/federation/tests/BackgroundJob/GetSharedSecretTest.php +++ b/apps/federation/tests/BackgroundJob/GetSharedSecretTest.php @@ -21,10 +21,8 @@ * */ - namespace OCA\Federation\Tests\BackgroundJob; - use OCA\Federation\BackgroundJob\GetSharedSecret; use OCA\Federation\DbHandler; use OCA\Federation\TrustedServers; diff --git a/apps/federation/tests/BackgroundJob/RequestSharedSecretTest.php b/apps/federation/tests/BackgroundJob/RequestSharedSecretTest.php index 283a7c0c6837..362a4942cbed 100644 --- a/apps/federation/tests/BackgroundJob/RequestSharedSecretTest.php +++ b/apps/federation/tests/BackgroundJob/RequestSharedSecretTest.php @@ -21,10 +21,8 @@ * */ - namespace OCA\Federation\Tests\BackgroundJob; - use OCA\Federation\BackgroundJob\RequestSharedSecret; use OCA\Federation\DbHandler; use OCA\Federation\TrustedServers; diff --git a/apps/federation/tests/Controller/SettingsControllerTest.php b/apps/federation/tests/Controller/SettingsControllerTest.php index a94282f4f811..bce59154a906 100644 --- a/apps/federation/tests/Controller/SettingsControllerTest.php +++ b/apps/federation/tests/Controller/SettingsControllerTest.php @@ -20,10 +20,8 @@ * */ - namespace OCA\Federation\Tests\Controller; - use OCA\Federation\Controller\SettingsController; use OCP\AppFramework\Http\DataResponse; use Test\TestCase; diff --git a/apps/federation/tests/DAV/FedAuthTest.php b/apps/federation/tests/DAV/FedAuthTest.php index 3f6868091ea6..f1bdb619bb72 100644 --- a/apps/federation/tests/DAV/FedAuthTest.php +++ b/apps/federation/tests/DAV/FedAuthTest.php @@ -19,7 +19,6 @@ * */ - namespace OCA\Federation\Tests\DAV; use OCA\Federation\DAV\FedAuth; diff --git a/apps/federation/tests/DbHandlerTest.php b/apps/federation/tests/DbHandlerTest.php index 608d6f26c3b5..6b41c9ec6d11 100644 --- a/apps/federation/tests/DbHandlerTest.php +++ b/apps/federation/tests/DbHandlerTest.php @@ -21,10 +21,8 @@ * */ - namespace OCA\Federation\Tests; - use OCA\Federation\DbHandler; use OCA\Federation\TrustedServers; use OCP\IDBConnection; @@ -117,7 +115,6 @@ public function testRemove() { $this->assertSame($id1, (int)$result[0]['id']); } - public function testGetServerById() { $this->dbHandler->addServer('server1'); $id = $this->dbHandler->addServer('server2'); diff --git a/apps/federation/tests/HooksTest.php b/apps/federation/tests/HooksTest.php index 64f8b56bd462..1a9d487cde02 100644 --- a/apps/federation/tests/HooksTest.php +++ b/apps/federation/tests/HooksTest.php @@ -20,10 +20,8 @@ * */ - namespace OCA\Federation\Tests; - use OCA\Federation\Hooks; use OCA\Federation\TrustedServers; use Test\TestCase; diff --git a/apps/federation/tests/Middleware/AddServerMiddlewareTest.php b/apps/federation/tests/Middleware/AddServerMiddlewareTest.php index 3182feff9e64..266154df31a2 100644 --- a/apps/federation/tests/Middleware/AddServerMiddlewareTest.php +++ b/apps/federation/tests/Middleware/AddServerMiddlewareTest.php @@ -20,10 +20,8 @@ * */ - namespace OCA\Federation\Tests\Middleware; - use OC\HintException; use OCA\Federation\Middleware\AddServerMiddleware; use OCP\AppFramework\Controller; diff --git a/apps/federation/tests/TrustedServersTest.php b/apps/federation/tests/TrustedServersTest.php index 6d2386f984f7..ab339ffeaea4 100644 --- a/apps/federation/tests/TrustedServersTest.php +++ b/apps/federation/tests/TrustedServersTest.php @@ -22,10 +22,8 @@ * */ - namespace OCA\Federation\Tests; - use OCA\Federation\DbHandler; use OCA\Federation\TrustedServers; use OCP\BackgroundJob\IJobList; @@ -226,7 +224,6 @@ public function testGetServers() { ); } - public function testIsTrustedServer() { $this->dbHandler->expects($this->once())->method('serverExists')->with('url') ->willReturn(true); diff --git a/apps/files/lib/App.php b/apps/files/lib/App.php index 1bf039934237..ce07aa099c95 100644 --- a/apps/files/lib/App.php +++ b/apps/files/lib/App.php @@ -22,7 +22,6 @@ * */ - namespace OCA\Files; class App { diff --git a/apps/files/lib/Command/Scan.php b/apps/files/lib/Command/Scan.php index a126b0b7f234..cb07a26f0589 100644 --- a/apps/files/lib/Command/Scan.php +++ b/apps/files/lib/Command/Scan.php @@ -455,7 +455,6 @@ protected function showSummary($headers, $rows, OutputInterface $output) { $table->render(); } - /** * Formats microtime into a human readable format * diff --git a/apps/files/lib/Command/VerifyChecksums.php b/apps/files/lib/Command/VerifyChecksums.php index 114201070718..58b5c1686152 100644 --- a/apps/files/lib/Command/VerifyChecksums.php +++ b/apps/files/lib/Command/VerifyChecksums.php @@ -21,7 +21,6 @@ namespace OCA\Files\Command; - use OC\Files\FileInfo; use OC\Files\Storage\Wrapper\Checksum; use OCP\Files\IRootFolder; @@ -35,7 +34,6 @@ use Symfony\Component\Console\Input\InputOption; use Symfony\Component\Console\Output\OutputInterface; - /** * Recomputes checksums for all files and compares them to filecache * entries. Provides repair option on mismatch. @@ -44,7 +42,6 @@ */ class VerifyChecksums extends Command { - const EXIT_NO_ERRORS = 0; const EXIT_CHECKSUM_ERRORS = 1; const EXIT_INVALID_ARGS = 2; @@ -150,11 +147,9 @@ public function execute(InputInterface $input, OutputInterface $output) { $this->userManager->callForAllUsers($scanUserFunction); } - return $this->exitStatus; } - /** * Recursive walk nodes * diff --git a/apps/files/tests/Command/VerifyChecksumsTest.php b/apps/files/tests/Command/VerifyChecksumsTest.php index 38d090150a73..998913e4d96e 100644 --- a/apps/files/tests/Command/VerifyChecksumsTest.php +++ b/apps/files/tests/Command/VerifyChecksumsTest.php @@ -17,7 +17,6 @@ class VerifyChecksumsTest extends TestCase { use \Test\Traits\UserTrait; - const BROKEN_CHECKSUM_STRING = '_BROKEN_'; /** @var CommandTester */ @@ -43,8 +42,6 @@ class VerifyChecksumsTest extends TestCase { */ private $testFiles; - - public function setUp() { parent::setUp(); @@ -53,7 +50,6 @@ public function setUp() { $this->user1 = $this->createRandomUser(1); $this->user2 = $this->createRandomUser(2); - $this->testFiles = [ $this->createFileForUser($this->user1, 'dir/nested/somefile.txt', 'Hello World!'), $this->createFileForUser($this->user1, 'dir/nested/subdir/hallo2.txt', 'ewfwfwefwef'), @@ -103,8 +99,6 @@ private function createFileForUser($uid, $path, $content) { $f = $userFolder->newFile("$currentDir/$fileName"); $f->putContent($content); - - return [ 'file' => $f, 'expectedChecksums' => function() use ($content) { @@ -118,7 +112,6 @@ private function createFileForUser($uid, $path, $content) { ]; } - /** * @param int $number * @return bool|IUser @@ -131,7 +124,6 @@ private function createRandomUser($number) { return $user->getUID(); } - private function breakChecksum(File &$f) { $cache = $f->getStorage()->getCache(); $cache->update($f->getId(), ['checksum' => self::BROKEN_CHECKSUM_STRING]); @@ -155,7 +147,6 @@ private function assertChecksumsAreCorrect(array $files) { } } - public function testNoBrokenChecksums() { $this->cmd->execute([]); $exitCode = $this->cmd->getStatusCode(); @@ -176,11 +167,9 @@ public function testBrokenChecksumsAreNotRepairedWithoutArguments() { $this->cmd->execute([]); $this->cmd->execute([]); - $exitCode = $this->cmd->getStatusCode(); $this->assertEquals(VerifyChecksums::EXIT_CHECKSUM_ERRORS, $exitCode, 'Wrong exit code'); - $this->assertEquals(self::BROKEN_CHECKSUM_STRING, $file1->getChecksum()); $this->assertEquals(self::BROKEN_CHECKSUM_STRING, $file2->getChecksum()); } diff --git a/apps/files_external/appinfo/routes.php b/apps/files_external/appinfo/routes.php index 16af7b610f6e..0d3f07a572f8 100644 --- a/apps/files_external/appinfo/routes.php +++ b/apps/files_external/appinfo/routes.php @@ -52,7 +52,6 @@ $this->create('files_external_oauth2', 'ajax/oauth2.php') ->actionInclude('files_external/ajax/oauth2.php'); - $this->create('files_external_list_applicable', '/applicable') ->actionInclude('files_external/ajax/applicable.php'); diff --git a/apps/files_external/lib/Controller/GlobalStoragesController.php b/apps/files_external/lib/Controller/GlobalStoragesController.php index ac0a8e4945d7..34f80284c736 100644 --- a/apps/files_external/lib/Controller/GlobalStoragesController.php +++ b/apps/files_external/lib/Controller/GlobalStoragesController.php @@ -25,7 +25,6 @@ namespace OCA\Files_External\Controller; - use OCP\AppFramework\Http; use OCP\AppFramework\Http\DataResponse; use OCP\Files\External\NotFoundException; @@ -192,5 +191,4 @@ public function update( ); } - } diff --git a/apps/files_external/lib/Controller/StoragesController.php b/apps/files_external/lib/Controller/StoragesController.php index 18b575e1a36d..4f065f7d6d67 100644 --- a/apps/files_external/lib/Controller/StoragesController.php +++ b/apps/files_external/lib/Controller/StoragesController.php @@ -26,7 +26,6 @@ namespace OCA\Files_External\Controller; - use OCP\AppFramework\Controller; use OCP\AppFramework\Http; use OCP\AppFramework\Http\DataResponse; diff --git a/apps/files_external/lib/Controller/UserStoragesController.php b/apps/files_external/lib/Controller/UserStoragesController.php index 32ddfd371371..0b91801b772e 100644 --- a/apps/files_external/lib/Controller/UserStoragesController.php +++ b/apps/files_external/lib/Controller/UserStoragesController.php @@ -25,7 +25,6 @@ namespace OCA\Files_External\Controller; - use OCP\AppFramework\Http; use OCP\AppFramework\Http\DataResponse; use OCP\Files\External\Auth\AuthMechanism; diff --git a/apps/files_sharing/ajax/shareinfo.php b/apps/files_sharing/ajax/shareinfo.php index 6cce853b2278..858884ad9198 100644 --- a/apps/files_sharing/ajax/shareinfo.php +++ b/apps/files_sharing/ajax/shareinfo.php @@ -100,7 +100,6 @@ function getChildInfo($dir, $view, $sharePermissions) { $result['mtime'] = $result['mtime'] / 1000; $result['permissions'] = (int)$result['permissions'] & $sharePermissions; - if ($rootInfo->getType() === 'dir') { $result['children'] = getChildInfo($rootInfo, $rootView, $sharePermissions); } diff --git a/apps/files_sharing/lib/API/Share20OCS.php b/apps/files_sharing/lib/API/Share20OCS.php index b3f6c93ec467..e17cfffbecc0 100644 --- a/apps/files_sharing/lib/API/Share20OCS.php +++ b/apps/files_sharing/lib/API/Share20OCS.php @@ -480,8 +480,6 @@ public function createShare() { return new \OC\OCS\Result(null, 403, $e->getMessage()); } - - $share->getNode()->unlock(\OCP\Lock\ILockingProvider::LOCK_SHARED); $formattedShareAfterCreate = $this->formatShare($share); diff --git a/apps/files_sharing/lib/Controller/ShareesController.php b/apps/files_sharing/lib/Controller/ShareesController.php index ae4c4de78b44..e3cd76ee107d 100644 --- a/apps/files_sharing/lib/Controller/ShareesController.php +++ b/apps/files_sharing/lib/Controller/ShareesController.php @@ -354,7 +354,6 @@ protected function getRemote($search) { foreach ($cloudIds as $cloudId) { list(, $serverUrl) = $this->splitUserRemote($cloudId); - if (\strtolower($cloudId) === $lowerSearch) { $foundRemoteById = true; // Save this as an exact match and continue with next CLOUD @@ -418,7 +417,6 @@ protected function getRemote($search) { $this->result['remotes'] = []; } - if (!$foundRemoteById && \substr_count($search, '@') >= 1 && $this->offset === 0 // if an exact local user is found, only keep the remote entry if // its domain does not matches the trusted domains diff --git a/apps/files_sharing/lib/External/Manager.php b/apps/files_sharing/lib/External/Manager.php index a36a338b193b..0c886bc7e072 100644 --- a/apps/files_sharing/lib/External/Manager.php +++ b/apps/files_sharing/lib/External/Manager.php @@ -362,7 +362,6 @@ protected function removeReShares($mountPointId) { ->where($selectQuery->expr()->eq('file_source', $query->createNamedParameter($mountPointId))); $select = $selectQuery->getSQL(); - $query->delete('federated_reshares') ->where($query->expr()->in('share_id', $query->createFunction('(' . $select . ')'))); $query->execute(); diff --git a/apps/files_sharing/lib/Helper.php b/apps/files_sharing/lib/Helper.php index 7bb1af491950..4bcc80774e95 100644 --- a/apps/files_sharing/lib/Helper.php +++ b/apps/files_sharing/lib/Helper.php @@ -176,7 +176,6 @@ public static function getSharesFromItem($target) { $path = $target; } - $ids = []; while ($path !== \dirname($path)) { $info = $ownerView->getFileInfo($path); diff --git a/apps/files_sharing/lib/Migration.php b/apps/files_sharing/lib/Migration.php index a02dd9a0cdb5..de82d5532fa4 100644 --- a/apps/files_sharing/lib/Migration.php +++ b/apps/files_sharing/lib/Migration.php @@ -160,7 +160,6 @@ private function getReShares() { ->orderBy('id', 'asc'); return $query->execute(); - $shares = $result->fetchAll(); $result->closeCursor(); @@ -252,7 +251,6 @@ private function updateOwners($owners) { ->set('uid_owner', $query->createNamedParameter($owner['owner'])) ->set('uid_initiator', $query->createNamedParameter($owner['initiator'])); - if ((int)$owner['type'] !== \OCP\Share::SHARE_TYPE_LINK) { $query->set('parent', $query->createNamedParameter(null)); } diff --git a/apps/files_sharing/lib/MountProvider.php b/apps/files_sharing/lib/MountProvider.php index 5ea476451489..7f14d33540a8 100644 --- a/apps/files_sharing/lib/MountProvider.php +++ b/apps/files_sharing/lib/MountProvider.php @@ -59,7 +59,6 @@ public function __construct(IConfig $config, IManager $shareManager, ILogger $lo $this->logger = $logger; } - /** * Get all mountpoints applicable for the user and check for shares where we need to update the etags * diff --git a/apps/files_sharing/lib/SharedMount.php b/apps/files_sharing/lib/SharedMount.php index fbdd8150b147..7cfa8b20f597 100644 --- a/apps/files_sharing/lib/SharedMount.php +++ b/apps/files_sharing/lib/SharedMount.php @@ -120,7 +120,6 @@ private function updateFileTarget($newPath, &$share) { } } - /** * @param string $path * @param View $view @@ -221,7 +220,6 @@ public function isTargetAllowed($target) { return true; } - /** * Move the mount point to $target * diff --git a/apps/files_sharing/lib/Updater.php b/apps/files_sharing/lib/Updater.php index ae1b63b4f13c..3945d71c9900 100644 --- a/apps/files_sharing/lib/Updater.php +++ b/apps/files_sharing/lib/Updater.php @@ -74,7 +74,6 @@ static private function moveShareToShare($path) { $newOwner = $dstMount->getShare()->getShareOwner(); } - //Ownership is moved over foreach ($shares as $share) { /** @var \OCP\Share\IShare $share */ diff --git a/apps/files_sharing/tests/API/Share20OCSTest.php b/apps/files_sharing/tests/API/Share20OCSTest.php index b67e5755d6c8..34e114ea59aa 100644 --- a/apps/files_sharing/tests/API/Share20OCSTest.php +++ b/apps/files_sharing/tests/API/Share20OCSTest.php @@ -128,7 +128,6 @@ public function tearDown() { parent::tearDown(); } - private function mockFormatShare() { return $this->getMockBuilder('OCA\Files_Sharing\API\Share20OCS') ->setConstructorArgs([ @@ -551,7 +550,6 @@ public function testCanAccessShare() { $group2 = $this->createMock('OCP\IGroup'); $group2->method('inGroup')->with($this->currentUser)->willReturn(false); - $this->groupManager->method('get')->will($this->returnValueMap([ ['group', $group], ['group2', $group2], @@ -2661,8 +2659,6 @@ public function dataFormatShare() { [], $share, [], true ]; - - return $result; } @@ -2687,7 +2683,6 @@ public function testFormatShare(array $expects, \OCP\Share\IShare $share, array ->with('files_sharing.sharecontroller.showShare', ['token' => 'myToken']) ->willReturn('myLink'); - $this->rootFolder->method('getUserFolder') ->with($this->currentUser->getUID()) ->will($this->returnSelf()); @@ -2755,7 +2750,6 @@ public function testDeleteShareApiDisabled() { $this->assertEquals($expected, $result); } - public function testCreateShareApiDisabled() { $ocs = $this->getOcsDisabledAPI(); diff --git a/apps/files_sharing/tests/ApiTest.php b/apps/files_sharing/tests/ApiTest.php index 70e57aec8391..64cfd3077372 100644 --- a/apps/files_sharing/tests/ApiTest.php +++ b/apps/files_sharing/tests/ApiTest.php @@ -51,7 +51,6 @@ class ApiTest extends TestCase { /** @var string */ private $subsubfolder; - protected function setUp() { parent::setUp(); @@ -187,7 +186,6 @@ function testCreateShareUserFolder() { $this->assertTrue($result->succeeded()); } - function testCreateShareGroupFile() { // simulate a post request $data['path'] = $this->filename; @@ -429,7 +427,6 @@ function testSharePermissions() { \OC::$server->getAppConfig()->setValue('core', 'shareapi_exclude_groups_list', ''); } - /** * @medium */ @@ -668,7 +665,6 @@ function testGetShareFromFolder() { ->setPermissions(1); $share2 = $this->shareManager->createShare($share2); - $request = $this->createRequest(['path' => $this->folder, 'subfiles' => 'true']); $ocs = $this->createOCS($request, self::TEST_FILES_SHARING_API_USER1); $result = $ocs->getShares(); @@ -1174,7 +1170,6 @@ function testUpdateShareExpireDate() { $share1 = $this->shareManager->getShareById($share1->getFullId()); - // date shouldn't be changed $this->assertEquals($dateWithinRange, $share1->getExpirationDate()); // cleanup diff --git a/apps/files_sharing/tests/BackendTest.php b/apps/files_sharing/tests/BackendTest.php index 029b49263ec4..dadd5aa4674c 100644 --- a/apps/files_sharing/tests/BackendTest.php +++ b/apps/files_sharing/tests/BackendTest.php @@ -25,7 +25,6 @@ namespace OCA\Files_Sharing\Tests; - /** * Class BackendTest * diff --git a/apps/files_sharing/tests/Controllers/ShareControllerTest.php b/apps/files_sharing/tests/Controllers/ShareControllerTest.php index a05ea451aad6..deb5bad5d0ca 100644 --- a/apps/files_sharing/tests/Controllers/ShareControllerTest.php +++ b/apps/files_sharing/tests/Controllers/ShareControllerTest.php @@ -104,7 +104,6 @@ protected function setUp() { $this->federatedShareProvider ); - // Store current user $this->oldUser = \OC_User::getUser(); @@ -307,7 +306,6 @@ public function testShowShareNotAuthenticated() { $this->assertEquals($expectedResponse, $response); } - public function testShowShare() { $owner = $this->createMock('OCP\IUser'); $owner->method('getDisplayName')->willReturn('ownerDisplay'); @@ -433,7 +431,6 @@ public function testShowShareInvalid() { $this->shareController->showShare('token'); } - public function testDownloadShare() { $share = $this->createMock('\OCP\Share\IShare'); $share->method('getPassword')->willReturn('password'); diff --git a/apps/files_sharing/tests/External/ManagerTest.php b/apps/files_sharing/tests/External/ManagerTest.php index 1bf69f19b5f6..891ac9447efc 100644 --- a/apps/files_sharing/tests/External/ManagerTest.php +++ b/apps/files_sharing/tests/External/ManagerTest.php @@ -291,7 +291,6 @@ public function testRemoveShare() { $this->assertNotMount('SharedFolder'); $this->assertNotMount('{{TemporaryMountPointName#' . $shareData1['name'] . '}}');*/ - $this->mountManager = $this->createMock(\OC\Files\Mount\Manager::class); $idbConnection = $this->createMock(\OCP\IDBConnection::class); $prepare = $this->createMock(\Doctrine\DBAL\Driver\Statement::class); diff --git a/apps/files_sharing/tests/Middleware/SharingCheckMiddlewareTest.php b/apps/files_sharing/tests/Middleware/SharingCheckMiddlewareTest.php index 924b0dcc7bd0..2c451a9be6d3 100644 --- a/apps/files_sharing/tests/Middleware/SharingCheckMiddlewareTest.php +++ b/apps/files_sharing/tests/Middleware/SharingCheckMiddlewareTest.php @@ -98,7 +98,6 @@ public function testIsLinkSharingEnabledWithEverythinEnabled() { $this->assertTrue(self::invokePrivate($this->sharingCheckMiddleware, 'isLinkSharingEnabled')); } - public function testIsLinkSharingEnabledWithLinkSharingDisabled() { $this->config ->expects($this->at(0)) @@ -283,5 +282,4 @@ public function testAfterExceptionWithS2SException() { $this->assertEquals(new JSONResponse('My Exception message', 405), $this->sharingCheckMiddleware->afterException($this->controllerMock, 'myMethod', new S2SException('My Exception message'))); } - } diff --git a/apps/files_sharing/tests/MigrationTest.php b/apps/files_sharing/tests/MigrationTest.php index a2bd9c36b0a6..bb3311c9d651 100644 --- a/apps/files_sharing/tests/MigrationTest.php +++ b/apps/files_sharing/tests/MigrationTest.php @@ -25,7 +25,6 @@ namespace OCA\Files_Sharing\Tests; - use OCA\Files_Sharing\Migration; /** diff --git a/apps/files_sharing/tests/PermissionsTest.php b/apps/files_sharing/tests/PermissionsTest.php index ab233eb8c81a..f80098223ca9 100644 --- a/apps/files_sharing/tests/PermissionsTest.php +++ b/apps/files_sharing/tests/PermissionsTest.php @@ -24,7 +24,6 @@ * */ - namespace OCA\Files_Sharing\Tests; use OC\Files\Cache\Cache; diff --git a/apps/files_sharing/tests/SharedMountTest.php b/apps/files_sharing/tests/SharedMountTest.php index f39ac99fba62..b5e3b4892ebd 100644 --- a/apps/files_sharing/tests/SharedMountTest.php +++ b/apps/files_sharing/tests/SharedMountTest.php @@ -43,7 +43,6 @@ protected function setUp() { $this->filename = '/share-api-storage.txt'; - $this->view->mkdir($this->folder); // save file with content @@ -268,8 +267,6 @@ public function dataPermissionMovedGroupShare() { ]; } - - /** * moved mountpoints of a group share should keep the same permission as their parent group share. * See #15253 diff --git a/apps/files_sharing/tests/SharedStorageTest.php b/apps/files_sharing/tests/SharedStorageTest.php index c7a660500439..f9dd077270ef 100644 --- a/apps/files_sharing/tests/SharedStorageTest.php +++ b/apps/files_sharing/tests/SharedStorageTest.php @@ -47,7 +47,6 @@ protected function setUp() { $this->filename = '/share-api-storage.txt'; - $this->view->mkdir($this->folder); // save file with content @@ -131,7 +130,6 @@ public function testRenamePartFile() { \OCP\Constants::PERMISSION_ALL ); - self::loginHelper(self::TEST_FILES_SHARING_API_USER2); $user2View = new \OC\Files\View('/' . self::TEST_FILES_SHARING_API_USER2 . '/files'); @@ -179,7 +177,6 @@ public function testFilesize() { \OCP\Constants::PERMISSION_READ | \OCP\Constants::PERMISSION_UPDATE | \OCP\Constants::PERMISSION_SHARE ); - self::loginHelper(self::TEST_FILES_SHARING_API_USER2); // compare file size between user1 and user2, should always be the same @@ -201,7 +198,6 @@ public function testGetPermissions() { \OCP\Constants::PERMISSION_READ ); - self::loginHelper(self::TEST_FILES_SHARING_API_USER2); $this->assertTrue(\OC\Files\Filesystem::is_dir($this->folder)); @@ -217,7 +213,6 @@ public function testGetPermissions() { $subfileInfo = \OC\Files\Filesystem::getFileInfo($this->folder . $this->filename); $this->assertSame(1, $subfileInfo->getPermissions()); - //cleanup $this->shareManager->deleteShare($share); } @@ -537,7 +532,6 @@ public function testNameConflict() { $this->shareManager->deleteShare($share2); } - public function testLongLock() { // https://github.com/owncloud/core/issues/25376 $fn = \str_repeat("x", 250); // maximum name length in oc_filecache diff --git a/apps/files_trashbin/ajax/isEmpty.php b/apps/files_trashbin/ajax/isEmpty.php index 2629cf96ccca..cabb19af446b 100644 --- a/apps/files_trashbin/ajax/isEmpty.php +++ b/apps/files_trashbin/ajax/isEmpty.php @@ -30,4 +30,3 @@ OCP\JSON::success(["data" => ["isEmpty" => $trashStatus]]); - diff --git a/apps/files_trashbin/lib/Quota.php b/apps/files_trashbin/lib/Quota.php index a475aa67fb2c..3a3d16d3c194 100644 --- a/apps/files_trashbin/lib/Quota.php +++ b/apps/files_trashbin/lib/Quota.php @@ -83,7 +83,6 @@ public function getPurgeLimit(){ return $this->config->getSystemValue('trashbin_purge_limit', self::DEFAULTMAXSIZE); } - /** * Get user quota or free space when there is no quota set * diff --git a/apps/files_trashbin/lib/Trashbin.php b/apps/files_trashbin/lib/Trashbin.php index 0d24d0bfa13d..40efe632720e 100644 --- a/apps/files_trashbin/lib/Trashbin.php +++ b/apps/files_trashbin/lib/Trashbin.php @@ -201,7 +201,6 @@ private static function setUpTrash($user) { return true; } - /** * copy file to owners trash * @@ -268,7 +267,6 @@ public static function insertTrashEntry($user, $targetFilename, $targetLocation, } } - /** * move file to the trash bin * diff --git a/apps/files_trashbin/list.php b/apps/files_trashbin/list.php index 1d5e5adf1195..ca6e422bbaed 100644 --- a/apps/files_trashbin/list.php +++ b/apps/files_trashbin/list.php @@ -23,7 +23,6 @@ // Check if we are a user OCP\User::checkLoggedIn(); - $tmpl = new OCP\Template('files_trashbin', 'index', ''); OCP\Util::addStyle('files_trashbin', 'trash'); OCP\Util::addScript('files_trashbin', 'app'); diff --git a/apps/files_trashbin/tests/Command/CleanUpTest.php b/apps/files_trashbin/tests/Command/CleanUpTest.php index 5960056c4e69..b68fe9b50c6b 100644 --- a/apps/files_trashbin/tests/Command/CleanUpTest.php +++ b/apps/files_trashbin/tests/Command/CleanUpTest.php @@ -21,10 +21,8 @@ * */ - namespace OCA\Files_Trashbin\Tests\Command; - use OC\User\Manager; use OCA\Files_Trashbin\Command\CleanUp; use OCP\Files\IRootFolder; diff --git a/apps/files_trashbin/tests/Command/ExpireTrashTest.php b/apps/files_trashbin/tests/Command/ExpireTrashTest.php index 4b92c8b02c25..b6f781248823 100644 --- a/apps/files_trashbin/tests/Command/ExpireTrashTest.php +++ b/apps/files_trashbin/tests/Command/ExpireTrashTest.php @@ -27,7 +27,6 @@ use Symfony\Component\Console\Tester\CommandTester; use Test\TestCase; - /** * Class ExpireTrashTest * diff --git a/apps/files_trashbin/tests/ExpirationTest.php b/apps/files_trashbin/tests/ExpirationTest.php index 6ae753592022..0aeae4490b12 100644 --- a/apps/files_trashbin/tests/ExpirationTest.php +++ b/apps/files_trashbin/tests/ExpirationTest.php @@ -110,7 +110,6 @@ public function testExpiration($retentionObligation, $timeNow, $timestamp, $quot $this->assertEquals($expectedResult, $actualResult); } - public function configData(){ return [ [ 'disabled', null, null, null], @@ -124,7 +123,6 @@ public function configData(){ ]; } - /** * @dataProvider configData * @@ -145,7 +143,6 @@ public function testParseRetentionObligation($configValue, $expectedMinAge, $exp $this->assertAttributeEquals($expectedCanPurgeToSaveSpace, 'canPurgeToSaveSpace', $expiration); } - public function timestampTestData(){ return [ [ 'disabled', false], @@ -159,7 +156,6 @@ public function timestampTestData(){ ]; } - /** * @dataProvider timestampTestData * diff --git a/apps/files_trashbin/tests/StorageTest.php b/apps/files_trashbin/tests/StorageTest.php index 68a820bf42ea..fe365f7e48ff 100644 --- a/apps/files_trashbin/tests/StorageTest.php +++ b/apps/files_trashbin/tests/StorageTest.php @@ -75,7 +75,6 @@ protected function setUp() { $this->user = $this->getUniqueId('user'); $this->createUser($this->user, $this->user); - // this will setup the FS $this->loginAsUser($this->user); diff --git a/apps/files_trashbin/tests/TrashbinTest.php b/apps/files_trashbin/tests/TrashbinTest.php index 82128e9d26b4..3aab8dc50ec1 100644 --- a/apps/files_trashbin/tests/TrashbinTest.php +++ b/apps/files_trashbin/tests/TrashbinTest.php @@ -97,7 +97,6 @@ public static function setUpBeforeClass() { self::loginHelper(self::TEST_TRASHBIN_USER1, true); } - public static function tearDownAfterClass() { // cleanup test user $user = \OC::$server->getUserManager()->get(self::TEST_TRASHBIN_USER1); @@ -162,7 +161,6 @@ protected function tearDown() { parent::tearDown(); } - /** * test expiration of files older then the max storage time defined for the trash * in this test we delete a shared file and check if both trash bins, the one from @@ -282,7 +280,6 @@ public function testExpireOldFiles() { $this->assertSame('file2.txt', $element['name']); } - /** * verify that the array contains the expected results * @@ -327,7 +324,6 @@ private function manipulateDeleteTime($files, $trashRoot, $expireDate) { return \OCA\Files\Helper::sortFiles($files, 'mtime'); } - /** * test expiration of old files in the trash bin until the max size * of the trash bin is met again diff --git a/apps/files_versions/lib/Command/CleanUp.php b/apps/files_versions/lib/Command/CleanUp.php index 5f81411eeb87..1fa1a71dcff6 100644 --- a/apps/files_versions/lib/Command/CleanUp.php +++ b/apps/files_versions/lib/Command/CleanUp.php @@ -21,7 +21,6 @@ namespace OCA\Files_Versions\Command; - use OCP\Files\IRootFolder; use OCP\IUserBackend; use OCP\IUserManager; @@ -59,7 +58,6 @@ protected function configure() { ); } - protected function execute(InputInterface $input, OutputInterface $output) { $users = $input->getArgument('user_id'); @@ -97,7 +95,6 @@ protected function execute(InputInterface $input, OutputInterface $output) { } } - /** * delete versions for the given user * diff --git a/apps/files_versions/lib/Command/Expire.php b/apps/files_versions/lib/Command/Expire.php index 97718895f30d..f8e971c07cbb 100644 --- a/apps/files_versions/lib/Command/Expire.php +++ b/apps/files_versions/lib/Command/Expire.php @@ -50,7 +50,6 @@ function __construct($user, $fileName) { $this->fileName = $fileName; } - public function handle() { $userManager = \OC::$server->getUserManager(); if (!$userManager->userExists($this->user)) { diff --git a/apps/files_versions/lib/Expiration.php b/apps/files_versions/lib/Expiration.php index 13b20e2e6d45..99b586e5d575 100644 --- a/apps/files_versions/lib/Expiration.php +++ b/apps/files_versions/lib/Expiration.php @@ -166,7 +166,6 @@ private function parseRetentionObligation(){ $maxValue = 'auto'; } - if ($minValue === 'auto' && $maxValue === 'auto') { // Default: Delete anytime if space needed $this->minAge = self::NO_OBLIGATION; diff --git a/apps/files_versions/lib/Hooks.php b/apps/files_versions/lib/Hooks.php index 4779e2c55cb0..1f386754df87 100644 --- a/apps/files_versions/lib/Hooks.php +++ b/apps/files_versions/lib/Hooks.php @@ -62,7 +62,6 @@ public static function write_hook($params) { } } - /** * Erase versions of deleted file * @param array $params diff --git a/apps/files_versions/lib/Storage.php b/apps/files_versions/lib/Storage.php index 35e63d4a1476..dc8f07b8dbb3 100644 --- a/apps/files_versions/lib/Storage.php +++ b/apps/files_versions/lib/Storage.php @@ -206,7 +206,6 @@ public static function store($filename) { } } - /** * mark file as deleted so that we can remove the versions if the file is gone * @param string $path @@ -319,7 +318,6 @@ public static function renameOrCopy($sourcePath, $targetPath, $operation) { } - public static function restoreVersion($uid, $filename, $fileToRestore, $revision) { if(\OCP\Config::getSystemValue('files_versions', Storage::DEFAULTENABLED) !== true) { return false; diff --git a/apps/files_versions/tests/Command/CleanupTest.php b/apps/files_versions/tests/Command/CleanupTest.php index 78feb539ce7c..6019c75826bb 100644 --- a/apps/files_versions/tests/Command/CleanupTest.php +++ b/apps/files_versions/tests/Command/CleanupTest.php @@ -20,10 +20,8 @@ * */ - namespace OCA\Files_Versions\Tests\Command; - use OC\User\Manager; use OCA\Files_Versions\Command\CleanUp; use OCP\Files\IRootFolder; @@ -55,7 +53,6 @@ public function setUp() { $this->userManager = $this->getMockBuilder('OC\User\Manager') ->disableOriginalConstructor()->getMock(); - $this->cleanup = new CleanUp($this->rootFolder, $this->userManager); } @@ -70,7 +67,6 @@ public function testDeleteVersions($nodeExists) { ->with('/testUser/files_versions') ->willReturn($nodeExists); - if($nodeExists) { $this->rootFolder->expects($this->once()) ->method('get') @@ -95,7 +91,6 @@ public function dataTestDeleteVersions() { ]; } - /** * test delete versions from users given as parameter */ diff --git a/apps/files_versions/tests/Command/ExpireVersionsTest.php b/apps/files_versions/tests/Command/ExpireVersionsTest.php index a2c959067f66..e9e3634b77a3 100644 --- a/apps/files_versions/tests/Command/ExpireVersionsTest.php +++ b/apps/files_versions/tests/Command/ExpireVersionsTest.php @@ -27,7 +27,6 @@ use Symfony\Component\Console\Tester\CommandTester; use Test\TestCase; - /** * Class ExpireVersionsTest * diff --git a/apps/files_versions/tests/ExpirationTest.php b/apps/files_versions/tests/ExpirationTest.php index 4dd359d5983a..505107503351 100644 --- a/apps/files_versions/tests/ExpirationTest.php +++ b/apps/files_versions/tests/ExpirationTest.php @@ -110,7 +110,6 @@ public function testExpiration($retentionObligation, $timeNow, $timestamp, $quot $this->assertEquals($expectedResult, $actualResult); } - public function configData(){ return [ [ 'disabled', null, null, null], @@ -126,7 +125,6 @@ public function configData(){ ]; } - /** * @dataProvider configData * diff --git a/apps/files_versions/tests/VersioningTest.php b/apps/files_versions/tests/VersioningTest.php index 537b94d0b29f..10cf6ddc0a22 100644 --- a/apps/files_versions/tests/VersioningTest.php +++ b/apps/files_versions/tests/VersioningTest.php @@ -388,7 +388,6 @@ public function testMoveFolder() { $this->assertTrue($this->rootView->file_exists($v2Renamed)); } - public function testCopy() { \OC\Files\Filesystem::file_put_contents("test.txt", "test file"); diff --git a/apps/provisioning_api/tests/AppsTest.php b/apps/provisioning_api/tests/AppsTest.php index 42e54e03bee0..5c2e78d2ea60 100644 --- a/apps/provisioning_api/tests/AppsTest.php +++ b/apps/provisioning_api/tests/AppsTest.php @@ -25,7 +25,6 @@ namespace OCA\Provisioning_API\Tests; - use OCA\Provisioning_API\Apps; use OCP\API; use OCP\App\IAppManager; diff --git a/apps/provisioning_api/tests/UsersTest.php b/apps/provisioning_api/tests/UsersTest.php index ac13265142e7..2ddafa7f6b05 100644 --- a/apps/provisioning_api/tests/UsersTest.php +++ b/apps/provisioning_api/tests/UsersTest.php @@ -655,12 +655,10 @@ public function testAddUserAsSubAdminExistingGroups() { ) ->willReturn(true); - $expected = new Result(null, 100); $this->assertEquals($expected, $this->api->addUser()); } - public function testGetUserNotLoggedIn() { $this->userSession ->expects($this->once()) @@ -1121,7 +1119,6 @@ public function providesQuota() { ]; } - /** * @dataProvider providesQuota * @param $expectedQuotaValueOnSetQuota @@ -1635,7 +1632,6 @@ public function testGetUsersGroupsForSubAdminUserAndUserIsAccessible() { $this->assertEquals($expected, $this->api->getUsersGroups(['userid' => 'UserToLookup'])); } - public function testGetUsersGroupsForSubAdminUserAndUserIsInaccessible() { $loggedInUser = $this->createMock(IUser::class); $loggedInUser diff --git a/apps/testing/locking/fakedblockingprovider.php b/apps/testing/locking/fakedblockingprovider.php index 2799f947858d..0203fd2378fd 100644 --- a/apps/testing/locking/fakedblockingprovider.php +++ b/apps/testing/locking/fakedblockingprovider.php @@ -45,7 +45,6 @@ public function __construct(IDBConnection $connection, ILogger $logger, ITimeFac $this->db = $connection; } - /** * @param string $path * @param int $type self::LOCK_SHARED or self::LOCK_EXCLUSIVE diff --git a/apps/updatenotification/lib/Notification/BackgroundJob.php b/apps/updatenotification/lib/Notification/BackgroundJob.php index 08016b69ae8d..fddf9eb2b8f1 100644 --- a/apps/updatenotification/lib/Notification/BackgroundJob.php +++ b/apps/updatenotification/lib/Notification/BackgroundJob.php @@ -21,7 +21,6 @@ namespace OCA\UpdateNotification\Notification; - use OC\BackgroundJob\TimedJob; use OC\Updater\VersionCheck; use OCP\App\IAppManager; @@ -117,7 +116,6 @@ protected function createNotifications($app, $version, $url) { $this->deleteOutdatedNotifications($app, $lastNotification); } - $notification = $this->notificationManager->createNotification(); $notification->setApp('updatenotification') ->setDateTime(new \DateTime()) diff --git a/apps/updatenotification/lib/Notification/Notifier.php b/apps/updatenotification/lib/Notification/Notifier.php index 9c7227d1ac39..7d12cc9176d5 100644 --- a/apps/updatenotification/lib/Notification/Notifier.php +++ b/apps/updatenotification/lib/Notification/Notifier.php @@ -21,7 +21,6 @@ namespace OCA\UpdateNotification\Notification; - use OCP\L10N\IFactory; use OCP\Notification\IManager; use OCP\Notification\INotification; diff --git a/apps/updatenotification/tests/Controller/AdminControllerTest.php b/apps/updatenotification/tests/Controller/AdminControllerTest.php index 20bfa2a49019..dd81fe4c504f 100644 --- a/apps/updatenotification/tests/Controller/AdminControllerTest.php +++ b/apps/updatenotification/tests/Controller/AdminControllerTest.php @@ -174,7 +174,6 @@ public function testDisplayPanelWithoutUpdate() { $this->assertEquals($expected, $this->adminController->displayPanel()); } - public function testCreateCredentials() { $this->jobList ->expects($this->once()) diff --git a/apps/updatenotification/tests/Notification/BackgroundJobTest.php b/apps/updatenotification/tests/Notification/BackgroundJobTest.php index 6b7fc8337590..2f8df62c855d 100644 --- a/apps/updatenotification/tests/Notification/BackgroundJobTest.php +++ b/apps/updatenotification/tests/Notification/BackgroundJobTest.php @@ -22,7 +22,6 @@ namespace OCA\UpdateNotification\Tests\Notification; - use OCA\UpdateNotification\Notification\BackgroundJob; use OCP\App\IAppManager; use OCP\Http\Client\IClientService; diff --git a/apps/updatenotification/tests/Notification/NotifierTest.php b/apps/updatenotification/tests/Notification/NotifierTest.php index a570e15252ca..31baf20fb8ca 100644 --- a/apps/updatenotification/tests/Notification/NotifierTest.php +++ b/apps/updatenotification/tests/Notification/NotifierTest.php @@ -22,7 +22,6 @@ namespace OCA\UpdateNotification\Tests\Notification; - use OCA\UpdateNotification\Notification\Notifier; use OCP\L10N\IFactory; use OCP\Notification\IManager; diff --git a/core/Command/Background/Base.php b/core/Command/Background/Base.php index 6b8521e93eb9..e7e1f27be0b9 100644 --- a/core/Command/Background/Base.php +++ b/core/Command/Background/Base.php @@ -38,7 +38,6 @@ */ abstract class Base extends Command { - abstract protected function getMode(); /** diff --git a/core/Command/Db/ConvertType.php b/core/Command/Db/ConvertType.php index c13a6d97801f..1fef8cce5273 100644 --- a/core/Command/Db/ConvertType.php +++ b/core/Command/Db/ConvertType.php @@ -269,7 +269,6 @@ protected function copyTable(Connection $fromDB, Connection $toDB, $table, Input $redraw = $count > $chunkSize ? 100 : ($count > 100 ? 5 : 1); $progress->setRedrawFrequency($redraw); - $query = $fromDB->getQueryBuilder(); $query->automaticTablePrefix(false); $query->select('*') diff --git a/core/Command/Db/Migrations/ExecuteCommand.php b/core/Command/Db/Migrations/ExecuteCommand.php index 7c75eee9c8a5..ca056ebea8d6 100644 --- a/core/Command/Db/Migrations/ExecuteCommand.php +++ b/core/Command/Db/Migrations/ExecuteCommand.php @@ -21,7 +21,6 @@ namespace OC\Core\Command\Db\Migrations; - use OC\DB\MigrationService; use OC\Migration\ConsoleOutput; use OCP\IDBConnection; diff --git a/core/Command/Db/Migrations/GenerateCommand.php b/core/Command/Db/Migrations/GenerateCommand.php index 145fd261e567..e557333d2cf7 100644 --- a/core/Command/Db/Migrations/GenerateCommand.php +++ b/core/Command/Db/Migrations/GenerateCommand.php @@ -21,7 +21,6 @@ namespace OC\Core\Command\Db\Migrations; - use OC\DB\MigrationService; use OC\Migration\ConsoleOutput; use OCP\IDBConnection; diff --git a/core/Command/Db/Migrations/MigrateCommand.php b/core/Command/Db/Migrations/MigrateCommand.php index a0f9a5ac1b67..35964e09b193 100644 --- a/core/Command/Db/Migrations/MigrateCommand.php +++ b/core/Command/Db/Migrations/MigrateCommand.php @@ -21,7 +21,6 @@ namespace OC\Core\Command\Db\Migrations; - use OC\DB\MigrationService; use OC\Migration\ConsoleOutput; use OCP\IDBConnection; diff --git a/core/Command/Db/Migrations/StatusCommand.php b/core/Command/Db/Migrations/StatusCommand.php index 4658e680ceb5..e7218fcb6e42 100644 --- a/core/Command/Db/Migrations/StatusCommand.php +++ b/core/Command/Db/Migrations/StatusCommand.php @@ -111,5 +111,4 @@ private function getFormattedVersionAlias(MigrationService $migrationService, $a return $migration; } - } diff --git a/core/Command/Encryption/ChangeKeyStorageRoot.php b/core/Command/Encryption/ChangeKeyStorageRoot.php index 8c9dd5bbc452..3f2110d21c0e 100644 --- a/core/Command/Encryption/ChangeKeyStorageRoot.php +++ b/core/Command/Encryption/ChangeKeyStorageRoot.php @@ -19,7 +19,6 @@ * */ - namespace OC\Core\Command\Encryption; use OC\Encryption\Keys\Storage; @@ -167,7 +166,6 @@ protected function moveSystemKeys($oldRoot, $newRoot) { } } - /** * setup file system for the given user * @@ -178,7 +176,6 @@ protected function setupUserFS($uid) { \OC_Util::setupFS($uid); } - /** * iterate over each user and move the keys to the new storage * @@ -191,7 +188,6 @@ protected function moveUserKeys($oldRoot, $newRoot, OutputInterface $output) { $progress = new ProgressBar($output); $progress->start(); - foreach($this->userManager->getBackends() as $backend) { $limit = 500; $offset = 0; diff --git a/core/Command/Encryption/SetDefaultModule.php b/core/Command/Encryption/SetDefaultModule.php index ac2339525c6e..5c9721729713 100644 --- a/core/Command/Encryption/SetDefaultModule.php +++ b/core/Command/Encryption/SetDefaultModule.php @@ -21,7 +21,6 @@ namespace OC\Core\Command\Encryption; - use OCP\Encryption\IManager; use Symfony\Component\Console\Command\Command; use Symfony\Component\Console\Input\InputArgument; diff --git a/core/Command/Encryption/ShowKeyStorageRoot.php b/core/Command/Encryption/ShowKeyStorageRoot.php index 4cb0af67f704..60be3d25ac1f 100644 --- a/core/Command/Encryption/ShowKeyStorageRoot.php +++ b/core/Command/Encryption/ShowKeyStorageRoot.php @@ -19,7 +19,6 @@ * */ - namespace OC\Core\Command\Encryption; use OC\Encryption\Util; diff --git a/core/Command/Maintenance/DataFingerprint.php b/core/Command/Maintenance/DataFingerprint.php index ccd1e9f4b243..94859d7764e4 100644 --- a/core/Command/Maintenance/DataFingerprint.php +++ b/core/Command/Maintenance/DataFingerprint.php @@ -31,7 +31,6 @@ use Symfony\Component\Console\Question\ConfirmationQuestion; use Symfony\Component\Console\Style\SymfonyStyle; - class DataFingerprint extends Command { /** @var IConfig */ diff --git a/core/Command/Upgrade.php b/core/Command/Upgrade.php index 9e3d3f2cfdfd..07bc1b5cb57c 100644 --- a/core/Command/Upgrade.php +++ b/core/Command/Upgrade.php @@ -183,7 +183,6 @@ protected function execute(InputInterface $input, OutputInterface $output) { $dispatcher->addListener('\OC\Repair::warning', $repairListener); $dispatcher->addListener('\OC\Repair::error', $repairListener); - $updater->listen('\OC\Updater', 'maintenanceEnabled', function () use($output) { $output->writeln('Turned on maintenance mode'); }); diff --git a/core/Command/User/SyncBackend.php b/core/Command/User/SyncBackend.php index 79b691e8cc2a..0a07610a16b2 100644 --- a/core/Command/User/SyncBackend.php +++ b/core/Command/User/SyncBackend.php @@ -22,7 +22,6 @@ namespace OC\Core\Command\User; - use OC\User\AccountMapper; use OC\User\Sync\AllUsersIterator; use OC\User\Sync\SeenUsersIterator; @@ -164,7 +163,6 @@ protected function execute(InputInterface $input, OutputInterface $output) { return 0; } - /** * @param InputInterface $input * @param OutputInterface $output diff --git a/core/Controller/LostController.php b/core/Controller/LostController.php index 746017163658..0c3d8da4d1b2 100644 --- a/core/Controller/LostController.php +++ b/core/Controller/LostController.php @@ -251,7 +251,6 @@ public function setPassword($token, $userId, $password, $proceed) { return $this->success(); } - /** * @param string $userId * @throws \Exception diff --git a/core/Migrations/Version20170101010100.php b/core/Migrations/Version20170101010100.php index 46ba9f4b47b1..e418c4f9ef47 100644 --- a/core/Migrations/Version20170101010100.php +++ b/core/Migrations/Version20170101010100.php @@ -678,7 +678,6 @@ public function changeSchema(Schema $schema, array $options) { $cardsPropertiesTable->addIndex(['cardid'], 'card_contactid_index'); } - if (!$schema->hasTable("${prefix}comments")) { $commentsTable = $schema->createTable("${prefix}comments"); @@ -799,7 +798,6 @@ public function changeSchema(Schema $schema, array $options) { $commentsTable->addIndex(['parent_id'], 'comments_parent_id_index'); } - if (!$schema->hasTable("${prefix}comments_read_markers")) { $commentsReadMarkersTable = $schema->createTable("${prefix}comments_read_markers"); diff --git a/core/Migrations/Version20170526104128.php b/core/Migrations/Version20170526104128.php index 05b8452d6587..a1a4853de05c 100644 --- a/core/Migrations/Version20170526104128.php +++ b/core/Migrations/Version20170526104128.php @@ -28,7 +28,6 @@ public function changeSchema(Schema $schema, array $options) { /** @var IDBConnection $db */ $db = \OC::$server->getDatabaseConnection(); - $qb = $db->getQueryBuilder(); $qb->select(['id', 'term']) ->from('account_terms') diff --git a/core/ajax/share.php b/core/ajax/share.php index a6494835190a..543664343fab 100644 --- a/core/ajax/share.php +++ b/core/ajax/share.php @@ -273,7 +273,6 @@ function usersInGroup($gid, $search = '', $limit = -1, $offset = 0) { case 'getItem': if (isset($_GET['itemType'], $_GET['itemSource'], $_GET['checkReshare'], $_GET['checkShares']) - ) { if ($_GET['checkReshare'] == 'true') { $reshare = OCP\Share::getItemSharedWithBySource( diff --git a/core/register_command.php b/core/register_command.php index 23c37cc9f950..4f6aa9c13272 100644 --- a/core/register_command.php +++ b/core/register_command.php @@ -55,7 +55,6 @@ \OC::$server->getIntegrityCodeChecker() )); - if (\OC::$server->getConfig()->getSystemValue('installed', false)) { $application->add(new OC\Core\Command\App\Disable(\OC::$server->getAppManager())); $application->add(new OC\Core\Command\App\Enable(\OC::$server->getAppManager())); diff --git a/lib/base.php b/lib/base.php index 45c35b7f8d92..d10051333914 100644 --- a/lib/base.php +++ b/lib/base.php @@ -159,7 +159,6 @@ public static function initPaths() { } } - if (OC::$CLI) { OC::$WEBROOT = self::$config->getValue('overwritewebroot', ''); } else { diff --git a/lib/private/Activity/Manager.php b/lib/private/Activity/Manager.php index cba66427ea19..785c379a528c 100644 --- a/lib/private/Activity/Manager.php +++ b/lib/private/Activity/Manager.php @@ -22,7 +22,6 @@ */ namespace OC\Activity; - use OCP\Activity\IConsumer; use OCP\Activity\IEvent; use OCP\Activity\IExtension; diff --git a/lib/private/AllConfig.php b/lib/private/AllConfig.php index eec7de838b02..0fb1cb529ff8 100644 --- a/lib/private/AllConfig.php +++ b/lib/private/AllConfig.php @@ -194,7 +194,6 @@ public function deleteAppValues($appName) { \OC::$server->getAppConfig()->deleteApp($appName); } - /** * Set a user defined value * @@ -421,7 +420,6 @@ public function getUsersForUserValue($appName, $key, $value) { ) ->andWhere($queryBuilder->expr()->isNotNull('configvalue')); - if ($this->connection->getDatabasePlatform() instanceof OraclePlatform) { //oracle can only compare the first 4000 bytes of a CLOB column $queryBuilder->andWhere($queryBuilder->expr()->eq( diff --git a/lib/private/App/CodeChecker/CodeChecker.php b/lib/private/App/CodeChecker/CodeChecker.php index e8f1e30a3147..fdd59a7eff3d 100644 --- a/lib/private/App/CodeChecker/CodeChecker.php +++ b/lib/private/App/CodeChecker/CodeChecker.php @@ -103,7 +103,6 @@ public function analyseFolder($folder) { return $errors; } - /** * @param string $file * @return array diff --git a/lib/private/AppFramework/App.php b/lib/private/AppFramework/App.php index 68674a351aec..17f5de943241 100644 --- a/lib/private/AppFramework/App.php +++ b/lib/private/AppFramework/App.php @@ -22,7 +22,6 @@ * */ - namespace OC\AppFramework; use OC\AppFramework\Http\Dispatcher; @@ -38,7 +37,6 @@ */ class App { - /** * Turns an app id into a namespace by either reading the appinfo.xml's * namespace tag or uppercasing the appid's first letter @@ -58,7 +56,6 @@ public static function buildAppNamespace($appId, $topNamespace='OCA\\') { return $topNamespace . \ucfirst($appId); } - /** * Shortcut for calling a controller method and printing the result * @param string $controllerName the name of the controller under which it is diff --git a/lib/private/AppFramework/Core/API.php b/lib/private/AppFramework/Core/API.php index 794b297b87bd..ddf6b7b88329 100644 --- a/lib/private/AppFramework/Core/API.php +++ b/lib/private/AppFramework/Core/API.php @@ -24,11 +24,9 @@ * */ - namespace OC\AppFramework\Core; use OCP\AppFramework\IApi; - /** * This is used to wrap the owncloud static api calls into an object to make the * code better abstractable for use in the dependency injection container @@ -49,7 +47,6 @@ public function __construct($appName){ $this->appName = $appName; } - /** * Gets the userid of the current user * @return string the user id of the current user @@ -59,7 +56,6 @@ public function getUserId(){ return \OCP\User::getUser(); } - /** * Adds a new javascript file * @deprecated include javascript and css in template files @@ -73,7 +69,6 @@ public function addScript($scriptName, $appName=null){ \OCP\Util::addScript($appName, $scriptName); } - /** * Adds a new css file * @deprecated include javascript and css in template files @@ -87,7 +82,6 @@ public function addStyle($styleName, $appName=null){ \OCP\Util::addStyle($appName, $styleName); } - /** * @deprecated include javascript and css in template files * shorthand for addScript for files in the 3rdparty directory @@ -97,7 +91,6 @@ public function add3rdPartyScript($name){ \OCP\Util::addScript($this->appName . '/3rdparty', $name); } - /** * @deprecated include javascript and css in template files * shorthand for addStyle for files in the 3rdparty directory @@ -107,7 +100,6 @@ public function add3rdPartyStyle($name){ \OCP\Util::addStyle($this->appName . '/3rdparty', $name); } - /** * @deprecated communication between apps should happen over built in * callbacks or interfaces (check the contacts and calendar managers) @@ -120,7 +112,6 @@ public function isAppEnabled($appName){ return \OCP\App::isEnabled($appName); } - /** * used to return and open a new event source * @return \OCP\IEventSource a new open EventSource class @@ -169,7 +160,6 @@ public function clearHook($signalClass=false, $signalName=false) { } } - /** * Register a backgroundjob task * @param string $className full namespace and class name of the class @@ -181,7 +171,6 @@ public function addRegularTask($className, $methodName) { \OCP\Backgroundjob::addRegularTask($className, $methodName); } - /** * Tells ownCloud to include a template in the admin overview * @param string $mainPath the path to the main php file without the php @@ -196,5 +185,4 @@ public function registerAdmin($mainPath, $appName=null) { \OCP\App::registerAdmin($appName, $mainPath); } - } diff --git a/lib/private/AppFramework/Db/Db.php b/lib/private/AppFramework/Db/Db.php index 3354054efdc7..665da12af875 100644 --- a/lib/private/AppFramework/Db/Db.php +++ b/lib/private/AppFramework/Db/Db.php @@ -65,7 +65,6 @@ public function prepareQuery($sql, $limit = null, $offset = null) { return new \OC_DB_StatementWrapper($statement, $isManipulation); } - /** * @inheritdoc */ diff --git a/lib/private/AppFramework/DependencyInjection/DIContainer.php b/lib/private/AppFramework/DependencyInjection/DIContainer.php index 02de4f91f8d0..0959e3f5128b 100644 --- a/lib/private/AppFramework/DependencyInjection/DIContainer.php +++ b/lib/private/AppFramework/DependencyInjection/DIContainer.php @@ -28,7 +28,6 @@ * */ - namespace OC\AppFramework\DependencyInjection; use OC; @@ -47,7 +46,6 @@ use OCP\Files\Mount\IMountManager; use OCP\IDateTimeFormatter; - class DIContainer extends SimpleContainer implements IAppContainer { /** @@ -219,7 +217,6 @@ public function __construct($appName, $urlParams = []){ $this->registerAlias('OCP\\AppFramework\\Utility\\ITimeFactory', 'OC\AppFramework\Utility\TimeFactory'); $this->registerAlias('TimeFactory', 'OCP\\AppFramework\\Utility\\ITimeFactory'); - $this->registerService('OCP\\Route\\IRouter', function($c) { return $this->getServer()->getRouter(); }); @@ -309,7 +306,6 @@ public function __construct($appName, $urlParams = []){ return $c->query('ServerContainer')->getWebRoot(); }); - /** * App Framework APIs */ @@ -341,7 +337,6 @@ public function __construct($appName, $urlParams = []){ return $this->getServer()->getThemeService(); }); - /** * Middleware */ @@ -403,7 +398,6 @@ public function __construct($appName, $urlParams = []){ } - /** * @deprecated implements only deprecated methods * @return IApi diff --git a/lib/private/AppFramework/Http.php b/lib/private/AppFramework/Http.php index 99b60d755ad2..6d8eeb33ae32 100644 --- a/lib/private/AppFramework/Http.php +++ b/lib/private/AppFramework/Http.php @@ -25,7 +25,6 @@ * */ - namespace OC\AppFramework; use OCP\AppFramework\Http as BaseHttp; @@ -107,7 +106,6 @@ public function __construct($server, $protocolVersion='HTTP/1.1') { ]; } - /** * Gets the correct header * @param Http::CONSTANT $status the constant from the Http class @@ -148,7 +146,5 @@ public function getStatusHeader($status, \DateTime $lastModified=null, $this->headers[$status]; } - } - diff --git a/lib/private/AppFramework/Http/Dispatcher.php b/lib/private/AppFramework/Http/Dispatcher.php index bf078f2f04b5..65cffdd311e2 100644 --- a/lib/private/AppFramework/Http/Dispatcher.php +++ b/lib/private/AppFramework/Http/Dispatcher.php @@ -24,7 +24,6 @@ * */ - namespace OC\AppFramework\Http; use \OC\AppFramework\Middleware\MiddlewareDispatcher; @@ -36,7 +35,6 @@ use OCP\AppFramework\Http\DataResponse; use OCP\IRequest; - /** * Class to dispatch the request to the middleware dispatcher */ @@ -65,7 +63,6 @@ public function __construct(Http $protocol, $this->request = $request; } - /** * Handles a request and calls the dispatcher on the controller * @param Controller $controller the controller which will be called @@ -116,7 +113,6 @@ public function dispatch(Controller $controller, $methodName) { return $out; } - /** * Uses the reflected parameters, types and request parameters to execute * the controller diff --git a/lib/private/AppFramework/Http/Request.php b/lib/private/AppFramework/Http/Request.php index ef97672210a0..cc840bb9135e 100644 --- a/lib/private/AppFramework/Http/Request.php +++ b/lib/private/AppFramework/Http/Request.php @@ -445,7 +445,6 @@ protected function decodeContent() { $this->contentDecoded = true; } - /** * Checks if the CSRF check was correct * @return bool true if CSRF check passed @@ -760,7 +759,6 @@ public function getInsecureServerHost() { return $host; } - /** * Returns the server host from the headers, or the first configured * trusted domain if the host isn't in the trusted list diff --git a/lib/private/AppFramework/Middleware/MiddlewareDispatcher.php b/lib/private/AppFramework/Middleware/MiddlewareDispatcher.php index e2e664d026d5..6179ac068269 100644 --- a/lib/private/AppFramework/Middleware/MiddlewareDispatcher.php +++ b/lib/private/AppFramework/Middleware/MiddlewareDispatcher.php @@ -24,7 +24,6 @@ * */ - namespace OC\AppFramework\Middleware; use OCP\AppFramework\Controller; @@ -47,7 +46,6 @@ class MiddlewareDispatcher { */ private $middlewareCounter; - /** * Constructor */ @@ -56,7 +54,6 @@ public function __construct(){ $this->middlewareCounter = 0; } - /** * Adds a new middleware * @param Middleware $middleWare the middleware which will be added @@ -65,7 +62,6 @@ public function registerMiddleware(Middleware $middleWare){ \array_push($this->middlewares, $middleWare); } - /** * returns an array with all middleware elements * @return array the middlewares @@ -74,7 +70,6 @@ public function getMiddlewares(){ return $this->middlewares; } - /** * This is being run in normal order before the controller is being * called which allows several modifications and checks @@ -94,7 +89,6 @@ public function beforeController(Controller $controller, $methodName){ } } - /** * This is being run when either the beforeController method or the * controller method itself is throwing an exception. The middleware is asked @@ -122,7 +116,6 @@ public function afterException(Controller $controller, $methodName, \Exception $ throw $exception; } - /** * This is being run after a successful controllermethod call and allows * the manipulation of a Response object. The middleware is run in reverse order @@ -141,7 +134,6 @@ public function afterController(Controller $controller, $methodName, Response $r return $response; } - /** * This is being run after the response object has been rendered and * allows the manipulation of the output. The middleware is run in reverse order diff --git a/lib/private/AppFramework/Middleware/Security/SecurityMiddleware.php b/lib/private/AppFramework/Middleware/Security/SecurityMiddleware.php index d6fb08d23154..75e080175d3e 100644 --- a/lib/private/AppFramework/Middleware/Security/SecurityMiddleware.php +++ b/lib/private/AppFramework/Middleware/Security/SecurityMiddleware.php @@ -25,7 +25,6 @@ * */ - namespace OC\AppFramework\Middleware\Security; use OC\AppFramework\Middleware\Security\Exceptions\AppNotEnabledException; @@ -107,7 +106,6 @@ public function __construct(IRequest $request, $this->contentSecurityPolicyManager = $contentSecurityPolicyManager; } - /** * This runs all the security checks before a method call. The * security checks are determined by inspecting the controller method diff --git a/lib/private/AppFramework/Utility/ControllerMethodReflector.php b/lib/private/AppFramework/Utility/ControllerMethodReflector.php index 03a40f8e271d..9e0a5234f136 100644 --- a/lib/private/AppFramework/Utility/ControllerMethodReflector.php +++ b/lib/private/AppFramework/Utility/ControllerMethodReflector.php @@ -23,12 +23,10 @@ * */ - namespace OC\AppFramework\Utility; use \OCP\AppFramework\Utility\IControllerMethodReflector; - /** * Reads and parses annotations from doc comments */ @@ -44,7 +42,6 @@ public function __construct() { $this->annotations = []; } - /** * @param object|string $object an object or classname * @param string $method the method which we want to inspect @@ -81,7 +78,6 @@ public function reflect($object, $method){ } } - /** * Inspects the PHPDoc parameters for types * @param string $parameter the parameter whose type comments should be @@ -97,7 +93,6 @@ public function getType($parameter) { } } - /** * @return array the arguments of the method with key => default value */ @@ -105,7 +100,6 @@ public function getParameters() { return $this->parameters; } - /** * Check if a method contains an annotation * @param string $name the name of the annotation @@ -115,5 +109,4 @@ public function hasAnnotation($name){ return \in_array($name, $this->annotations); } - } diff --git a/lib/private/AppFramework/Utility/SimpleContainer.php b/lib/private/AppFramework/Utility/SimpleContainer.php index 56931cc34f8d..91cf46b96569 100644 --- a/lib/private/AppFramework/Utility/SimpleContainer.php +++ b/lib/private/AppFramework/Utility/SimpleContainer.php @@ -40,7 +40,6 @@ */ class SimpleContainer extends Container implements IContainer { - /** * @param ReflectionClass $class the class to instantiate * @return \stdClass the created class @@ -76,7 +75,6 @@ private function buildClass(ReflectionClass $class) { } } - /** * If a parameter is not registered in the container try to instantiate it * by using reflection to find out how to build the class @@ -99,7 +97,6 @@ public function resolve($name) { } } - /** * @param string $name name of the service to query for * @return mixed registered service for the given $name diff --git a/lib/private/AppFramework/Utility/TimeFactory.php b/lib/private/AppFramework/Utility/TimeFactory.php index 601771c2f72e..051875684f41 100644 --- a/lib/private/AppFramework/Utility/TimeFactory.php +++ b/lib/private/AppFramework/Utility/TimeFactory.php @@ -21,18 +21,15 @@ * */ - namespace OC\AppFramework\Utility; use OCP\AppFramework\Utility\ITimeFactory; - /** * Needed to mock calls to time() */ class TimeFactory implements ITimeFactory { - /** * @return int the result of a call to time() */ @@ -40,5 +37,4 @@ public function getTime() { return \time(); } - } diff --git a/lib/private/Cache/CappedMemoryCache.php b/lib/private/Cache/CappedMemoryCache.php index 2470abd6df03..99f985711888 100644 --- a/lib/private/Cache/CappedMemoryCache.php +++ b/lib/private/Cache/CappedMemoryCache.php @@ -76,7 +76,6 @@ public function offsetUnset($offset) { $this->remove($offset); } - private function garbageCollect() { while (\count($this->cache) > $this->capacity) { \reset($this->cache); diff --git a/lib/private/CapabilitiesManager.php b/lib/private/CapabilitiesManager.php index 40f27b05af5b..3c34c893d34e 100644 --- a/lib/private/CapabilitiesManager.php +++ b/lib/private/CapabilitiesManager.php @@ -21,7 +21,6 @@ */ namespace OC; - use OCP\Capabilities\ICapability; class CapabilitiesManager { diff --git a/lib/private/Comments/Comment.php b/lib/private/Comments/Comment.php index 3678b74c0d8d..8ef12483266b 100644 --- a/lib/private/Comments/Comment.php +++ b/lib/private/Comments/Comment.php @@ -131,7 +131,6 @@ public function getTopmostParentId() { return $this->data['topmostParentId']; } - /** * sets the topmost parent ID and returns itself * diff --git a/lib/private/Console/TimestampFormatter.php b/lib/private/Console/TimestampFormatter.php index 99ef2cca01cc..44ba80ae7df2 100644 --- a/lib/private/Console/TimestampFormatter.php +++ b/lib/private/Console/TimestampFormatter.php @@ -21,7 +21,6 @@ namespace OC\Console; - use OCP\IConfig; use Symfony\Component\Console\Formatter\OutputFormatterInterface; use Symfony\Component\Console\Formatter\OutputFormatterStyleInterface; diff --git a/lib/private/DB/AdapterMySQL.php b/lib/private/DB/AdapterMySQL.php index 18a2f85a85c3..1cf23ea5a625 100644 --- a/lib/private/DB/AdapterMySQL.php +++ b/lib/private/DB/AdapterMySQL.php @@ -21,7 +21,6 @@ * */ - namespace OC\DB; class AdapterMySQL extends Adapter { diff --git a/lib/private/DB/AdapterOCI8.php b/lib/private/DB/AdapterOCI8.php index d67308c538b4..4660584e5fe7 100644 --- a/lib/private/DB/AdapterOCI8.php +++ b/lib/private/DB/AdapterOCI8.php @@ -22,7 +22,6 @@ * */ - namespace OC\DB; class AdapterOCI8 extends Adapter { diff --git a/lib/private/DB/AdapterPgSql.php b/lib/private/DB/AdapterPgSql.php index 29ce5ff5163e..ee5268e8fc17 100644 --- a/lib/private/DB/AdapterPgSql.php +++ b/lib/private/DB/AdapterPgSql.php @@ -20,7 +20,6 @@ * */ - namespace OC\DB; class AdapterPgSql extends Adapter { diff --git a/lib/private/DB/AdapterSqlite.php b/lib/private/DB/AdapterSqlite.php index 530aca64ab08..8fc56dd5bb98 100644 --- a/lib/private/DB/AdapterSqlite.php +++ b/lib/private/DB/AdapterSqlite.php @@ -23,7 +23,6 @@ * */ - namespace OC\DB; class AdapterSqlite extends Adapter { diff --git a/lib/private/DB/MigrationException.php b/lib/private/DB/MigrationException.php index 2da68a7b88a1..ab2dfe181fc5 100644 --- a/lib/private/DB/MigrationException.php +++ b/lib/private/DB/MigrationException.php @@ -22,7 +22,6 @@ namespace OC\DB; - class MigrationException extends \Exception { private $table; diff --git a/lib/private/DB/MySqlSchemaColumnDefinitionListener.php b/lib/private/DB/MySqlSchemaColumnDefinitionListener.php index fb51af87ed56..a2501f1ce7ae 100644 --- a/lib/private/DB/MySqlSchemaColumnDefinitionListener.php +++ b/lib/private/DB/MySqlSchemaColumnDefinitionListener.php @@ -27,7 +27,6 @@ use Doctrine\DBAL\Schema\Column; use Doctrine\DBAL\Types\Type; - /** * Class MySqlSchemaColumnDefinitionListener * @@ -66,7 +65,6 @@ public function onSchemaColumnDefinition(SchemaColumnDefinitionEventArgs $eventA } } - /** * Given a table comment this method tries to extract a typehint for Doctrine Type, or returns * the type given as default. diff --git a/lib/private/DB/QueryBuilder/ExpressionBuilder/MySqlExpressionBuilder.php b/lib/private/DB/QueryBuilder/ExpressionBuilder/MySqlExpressionBuilder.php index 5230d7886ee9..ae67cf77884c 100644 --- a/lib/private/DB/QueryBuilder/ExpressionBuilder/MySqlExpressionBuilder.php +++ b/lib/private/DB/QueryBuilder/ExpressionBuilder/MySqlExpressionBuilder.php @@ -21,7 +21,6 @@ namespace OC\DB\QueryBuilder\ExpressionBuilder; - use OC\DB\QueryBuilder\QueryFunction; class MySqlExpressionBuilder extends ExpressionBuilder { diff --git a/lib/private/DB/QueryBuilder/ExpressionBuilder/OCIExpressionBuilder.php b/lib/private/DB/QueryBuilder/ExpressionBuilder/OCIExpressionBuilder.php index 8fbb4d6937cd..05f8926040c4 100644 --- a/lib/private/DB/QueryBuilder/ExpressionBuilder/OCIExpressionBuilder.php +++ b/lib/private/DB/QueryBuilder/ExpressionBuilder/OCIExpressionBuilder.php @@ -23,7 +23,6 @@ namespace OC\DB\QueryBuilder\ExpressionBuilder; - use OC\DB\QueryBuilder\QueryFunction; use OCP\DB\QueryBuilder\ILiteral; use OCP\DB\QueryBuilder\IParameter; diff --git a/lib/private/DB/QueryBuilder/ExpressionBuilder/PgSqlExpressionBuilder.php b/lib/private/DB/QueryBuilder/ExpressionBuilder/PgSqlExpressionBuilder.php index b44fc77c077c..7bf2d1199a87 100644 --- a/lib/private/DB/QueryBuilder/ExpressionBuilder/PgSqlExpressionBuilder.php +++ b/lib/private/DB/QueryBuilder/ExpressionBuilder/PgSqlExpressionBuilder.php @@ -22,7 +22,6 @@ namespace OC\DB\QueryBuilder\ExpressionBuilder; - use OC\DB\QueryBuilder\QueryFunction; use OCP\DB\QueryBuilder\IQueryBuilder; diff --git a/lib/private/DateTimeZone.php b/lib/private/DateTimeZone.php index 4dd815230658..33149e1fc9c7 100644 --- a/lib/private/DateTimeZone.php +++ b/lib/private/DateTimeZone.php @@ -22,7 +22,6 @@ namespace OC; - use OCP\IConfig; use OCP\IDateTimeZone; use OCP\ISession; diff --git a/lib/private/Encryption/DecryptAll.php b/lib/private/Encryption/DecryptAll.php index 4ae1ab5c88c2..88e8a4c681c8 100644 --- a/lib/private/Encryption/DecryptAll.php +++ b/lib/private/Encryption/DecryptAll.php @@ -23,7 +23,6 @@ * */ - namespace OC\Encryption; use OC\Encryption\Exceptions\DecryptionFailedException; @@ -276,7 +275,6 @@ protected function getTimestamp() { return \time(); } - /** * setup user file system * diff --git a/lib/private/Encryption/EncryptionWrapper.php b/lib/private/Encryption/EncryptionWrapper.php index fd8349524ced..423aa13c2eb4 100644 --- a/lib/private/Encryption/EncryptionWrapper.php +++ b/lib/private/Encryption/EncryptionWrapper.php @@ -20,10 +20,8 @@ * */ - namespace OC\Encryption; - use OC\Memcache\ArrayCache; use OC\Files\Filesystem; use OC\Files\Storage\Wrapper\Encryption; diff --git a/lib/private/Encryption/Exceptions/DecryptionFailedException.php b/lib/private/Encryption/Exceptions/DecryptionFailedException.php index 1c1006218453..a79604d542b1 100644 --- a/lib/private/Encryption/Exceptions/DecryptionFailedException.php +++ b/lib/private/Encryption/Exceptions/DecryptionFailedException.php @@ -20,7 +20,6 @@ * */ - namespace OC\Encryption\Exceptions; use OCP\Encryption\Exceptions\GenericEncryptionException; diff --git a/lib/private/Encryption/Exceptions/EmptyEncryptionDataException.php b/lib/private/Encryption/Exceptions/EmptyEncryptionDataException.php index a0ac2437ed53..6e0438612cf6 100644 --- a/lib/private/Encryption/Exceptions/EmptyEncryptionDataException.php +++ b/lib/private/Encryption/Exceptions/EmptyEncryptionDataException.php @@ -20,7 +20,6 @@ * */ - namespace OC\Encryption\Exceptions; use OCP\Encryption\Exceptions\GenericEncryptionException; diff --git a/lib/private/Encryption/Exceptions/EncryptionFailedException.php b/lib/private/Encryption/Exceptions/EncryptionFailedException.php index 1623c5c9d5c1..b6bec7c7dc2e 100644 --- a/lib/private/Encryption/Exceptions/EncryptionFailedException.php +++ b/lib/private/Encryption/Exceptions/EncryptionFailedException.php @@ -20,7 +20,6 @@ * */ - namespace OC\Encryption\Exceptions; use OCP\Encryption\Exceptions\GenericEncryptionException; diff --git a/lib/private/Encryption/Exceptions/EncryptionHeaderToLargeException.php b/lib/private/Encryption/Exceptions/EncryptionHeaderToLargeException.php index c7af877f546d..3916cb8c8615 100644 --- a/lib/private/Encryption/Exceptions/EncryptionHeaderToLargeException.php +++ b/lib/private/Encryption/Exceptions/EncryptionHeaderToLargeException.php @@ -20,7 +20,6 @@ * */ - namespace OC\Encryption\Exceptions; use OCP\Encryption\Exceptions\GenericEncryptionException; diff --git a/lib/private/Encryption/Exceptions/UnknownCipherException.php b/lib/private/Encryption/Exceptions/UnknownCipherException.php index 284e98cb64dc..ac2fac190189 100644 --- a/lib/private/Encryption/Exceptions/UnknownCipherException.php +++ b/lib/private/Encryption/Exceptions/UnknownCipherException.php @@ -20,7 +20,6 @@ * */ - namespace OC\Encryption\Exceptions; use OCP\Encryption\Exceptions\GenericEncryptionException; diff --git a/lib/private/Encryption/File.php b/lib/private/Encryption/File.php index 2ea8582a016f..2d0e7c592841 100644 --- a/lib/private/Encryption/File.php +++ b/lib/private/Encryption/File.php @@ -42,7 +42,6 @@ public function __construct(Util $util) { $this->cache = new CappedMemoryCache(); } - /** * get list of users with access to the file * @@ -64,7 +63,6 @@ public function getAccessList($path) { $ownerPath = \substr($ownerPath, \strlen('/files')); $ownerPath = $this->util->stripPartialFileExtension($ownerPath); - // first get the shares for the parent and cache the result so that we don't // need to check all parents for every file $parent = \dirname($ownerPath); @@ -77,7 +75,6 @@ public function getAccessList($path) { $userIds = \array_merge($userIds, $resultForParents['users']); $public = $resultForParents['public'] || $resultForParents['remote']; - // Find out who, if anyone, is sharing the file $resultForFile = \OCP\Share::getUsersSharingFile($ownerPath, $owner, false, false, false); $userIds = \array_merge($userIds, $resultForFile['users']); diff --git a/lib/private/Encryption/Keys/Storage.php b/lib/private/Encryption/Keys/Storage.php index 89264bb5ab66..5dd14fcf2f0f 100644 --- a/lib/private/Encryption/Keys/Storage.php +++ b/lib/private/Encryption/Keys/Storage.php @@ -310,7 +310,6 @@ public function renameKeys($source, $target) { return false; } - /** * copy keys if a file was renamed * diff --git a/lib/private/Encryption/Manager.php b/lib/private/Encryption/Manager.php index 50aef6bebb2f..275ab31363f2 100644 --- a/lib/private/Encryption/Manager.php +++ b/lib/private/Encryption/Manager.php @@ -258,7 +258,6 @@ public function setupStorage() { Filesystem::addStorageWrapper('oc_encryption', [$encryptionWrapper, 'wrapStorage'], 2); } - /** * check if key storage is ready * @@ -281,5 +280,4 @@ protected function isKeyStorageReady() { return false; } - } diff --git a/lib/private/Encryption/Util.php b/lib/private/Encryption/Util.php index 10d1bd3f06c0..56d4ee6f7af6 100644 --- a/lib/private/Encryption/Util.php +++ b/lib/private/Encryption/Util.php @@ -357,7 +357,6 @@ public function isExcluded($path) { return true; } - //detect system wide folders if (\in_array($root[1], $this->excludedPaths)) { return true; diff --git a/lib/private/Files/Cache/Cache.php b/lib/private/Files/Cache/Cache.php index e30152293693..eea3ada08aad 100644 --- a/lib/private/Files/Cache/Cache.php +++ b/lib/private/Files/Cache/Cache.php @@ -597,7 +597,6 @@ public function search($pattern) { // normalize pattern $pattern = $this->normalize($pattern); - $sql = ' SELECT `fileid`, `storage`, `path`, `parent`, `name`, `mimetype`, `mimepart`, `size`, `mtime`, `encrypted`, diff --git a/lib/private/Files/Cache/CacheEntry.php b/lib/private/Files/Cache/CacheEntry.php index 2a7f9c67822f..f5e647848d03 100644 --- a/lib/private/Files/Cache/CacheEntry.php +++ b/lib/private/Files/Cache/CacheEntry.php @@ -64,22 +64,18 @@ public function getStorageId() { return $this->data['storage']; } - public function getPath() { return $this->data['path']; } - public function getName() { return $this->data['name']; } - public function getMimeType() { return $this->data['mimetype']; } - public function getMimePart() { return $this->data['mimepart']; } diff --git a/lib/private/Files/Cache/FailedCache.php b/lib/private/Files/Cache/FailedCache.php index a62c793da6fe..41cea1527291 100644 --- a/lib/private/Files/Cache/FailedCache.php +++ b/lib/private/Files/Cache/FailedCache.php @@ -40,7 +40,6 @@ public function __construct($visible = true) { $this->visible = $visible; } - public function getNumericStorageId() { return -1; } diff --git a/lib/private/Files/Cache/HomePropagator.php b/lib/private/Files/Cache/HomePropagator.php index e1db173a4be1..dc99b78eb639 100644 --- a/lib/private/Files/Cache/HomePropagator.php +++ b/lib/private/Files/Cache/HomePropagator.php @@ -34,7 +34,6 @@ public function __construct(\OC\Files\Storage\Storage $storage, IDBConnection $c $this->ignoredBaseFolders = ['files_encryption']; } - /** * @param string $internalPath * @param int $time diff --git a/lib/private/Files/Cache/Propagator.php b/lib/private/Files/Cache/Propagator.php index 0a8ea7328b68..cf33048e4856 100644 --- a/lib/private/Files/Cache/Propagator.php +++ b/lib/private/Files/Cache/Propagator.php @@ -52,7 +52,6 @@ public function __construct(\OC\Files\Storage\Storage $storage, IDBConnection $c $this->connection = $connection; } - /** * @param string $internalPath * @param int $time @@ -183,5 +182,4 @@ public function commitBatch() { $this->connection->commit(); } - } diff --git a/lib/private/Files/Cache/Scanner.php b/lib/private/Files/Cache/Scanner.php index a92c9b8cfd88..9e06ca346ad3 100644 --- a/lib/private/Files/Cache/Scanner.php +++ b/lib/private/Files/Cache/Scanner.php @@ -212,7 +212,6 @@ public function scanFile($file, $reuseExisting = 0, $parentId = -1, $cacheData = } } - $data['fileid'] = $this->addToCache($file, $newData, $fileId); } if (isset($cacheData['size'])) { diff --git a/lib/private/Files/External/Auth/NullMechanism.php b/lib/private/Files/External/Auth/NullMechanism.php index 0ef2470a7ef8..c0f5613475fe 100644 --- a/lib/private/Files/External/Auth/NullMechanism.php +++ b/lib/private/Files/External/Auth/NullMechanism.php @@ -22,7 +22,6 @@ namespace OC\Files\External\Auth; - use \OCP\Files\External\Auth\AuthMechanism; /** diff --git a/lib/private/Files/External/DependencyTrait.php b/lib/private/Files/External/DependencyTrait.php index 50ae277247fa..d875f4ff554f 100644 --- a/lib/private/Files/External/DependencyTrait.php +++ b/lib/private/Files/External/DependencyTrait.php @@ -22,7 +22,6 @@ namespace OC\Files\External; - /** * Trait for objects that have dependencies for use */ diff --git a/lib/private/Files/External/Service/GlobalStoragesService.php b/lib/private/Files/External/Service/GlobalStoragesService.php index c4e491c79d92..6631367f6fe5 100644 --- a/lib/private/Files/External/Service/GlobalStoragesService.php +++ b/lib/private/Files/External/Service/GlobalStoragesService.php @@ -25,7 +25,6 @@ namespace OC\Files\External\Service; - use OC\Files\Filesystem; use OCP\Files\External\IStorageConfig; diff --git a/lib/private/Files/Meta/MetaFileIdNode.php b/lib/private/Files/Meta/MetaFileIdNode.php index f0bdafcae004..d01f852f8c30 100644 --- a/lib/private/Files/Meta/MetaFileIdNode.php +++ b/lib/private/Files/Meta/MetaFileIdNode.php @@ -19,7 +19,6 @@ * */ - namespace OC\Files\Meta; use OC\Files\Node\AbstractFolder; diff --git a/lib/private/Files/Meta/MetaRootNode.php b/lib/private/Files/Meta/MetaRootNode.php index afa736b4c8b6..6a893652c115 100644 --- a/lib/private/Files/Meta/MetaRootNode.php +++ b/lib/private/Files/Meta/MetaRootNode.php @@ -19,10 +19,8 @@ * */ - namespace OC\Files\Meta; - use OC\Files\Node\AbstractFolder; use OCP\Constants; use OCP\Files\FileInfo; diff --git a/lib/private/Files/Meta/MetaVersionCollection.php b/lib/private/Files/Meta/MetaVersionCollection.php index 79ac378b7a39..652ee45a2001 100644 --- a/lib/private/Files/Meta/MetaVersionCollection.php +++ b/lib/private/Files/Meta/MetaVersionCollection.php @@ -19,10 +19,8 @@ * */ - namespace OC\Files\Meta; - use OC\Files\Node\AbstractFolder; use OCP\Files\IRootFolder; use OCP\Files\Storage\IVersionedStorage; diff --git a/lib/private/Files/Node/AbstractFile.php b/lib/private/Files/Node/AbstractFile.php index 86b2f35e6782..92034603f36c 100644 --- a/lib/private/Files/Node/AbstractFile.php +++ b/lib/private/Files/Node/AbstractFile.php @@ -19,10 +19,8 @@ * */ - namespace OC\Files\Node; - use OCP\Files\FileInfo; use OCP\Files\NotPermittedException; diff --git a/lib/private/Files/Node/AbstractFolder.php b/lib/private/Files/Node/AbstractFolder.php index 2a9c39bc7e6c..6f3273483089 100644 --- a/lib/private/Files/Node/AbstractFolder.php +++ b/lib/private/Files/Node/AbstractFolder.php @@ -19,10 +19,8 @@ * */ - namespace OC\Files\Node; - use OC\Files\FileInfo; use OCP\Files\NotFoundException; use OCP\Files\NotPermittedException; diff --git a/lib/private/Files/Node/AbstractNode.php b/lib/private/Files/Node/AbstractNode.php index f9d0dea641f7..9e932497d410 100644 --- a/lib/private/Files/Node/AbstractNode.php +++ b/lib/private/Files/Node/AbstractNode.php @@ -19,7 +19,6 @@ * */ - namespace OC\Files\Node; use OCP\Files\NotPermittedException; diff --git a/lib/private/Files/Node/LazyRoot.php b/lib/private/Files/Node/LazyRoot.php index c4c55d3eb17e..a00fabbb67c9 100644 --- a/lib/private/Files/Node/LazyRoot.php +++ b/lib/private/Files/Node/LazyRoot.php @@ -470,5 +470,4 @@ public function unlock($type) { return $this->__call(__FUNCTION__, \func_get_args()); } - } diff --git a/lib/private/Files/ObjectStore/HomeObjectStoreStorage.php b/lib/private/Files/ObjectStore/HomeObjectStoreStorage.php index dd091fe7dd93..b6fbdb235bcb 100644 --- a/lib/private/Files/ObjectStore/HomeObjectStoreStorage.php +++ b/lib/private/Files/ObjectStore/HomeObjectStoreStorage.php @@ -68,5 +68,4 @@ public function getUser($path = null) { return $this->user; } - } \ No newline at end of file diff --git a/lib/private/Files/ObjectStore/ObjectStoreStorage.php b/lib/private/Files/ObjectStore/ObjectStoreStorage.php index 45f4f08e1188..01fceda86bdb 100644 --- a/lib/private/Files/ObjectStore/ObjectStoreStorage.php +++ b/lib/private/Files/ObjectStore/ObjectStoreStorage.php @@ -336,7 +336,6 @@ public function moveFromStorage(\OCP\Files\Storage $sourceStorage, $sourceIntern return true; } - public function getMimeType($path) { $path = $this->normalizePath($path); $stat = $this->stat($path); diff --git a/lib/private/Files/Storage/Home.php b/lib/private/Files/Storage/Home.php index 3086a815bedc..23ad25232938 100644 --- a/lib/private/Files/Storage/Home.php +++ b/lib/private/Files/Storage/Home.php @@ -86,7 +86,6 @@ public function getPropagator($storage = null) { return $this->propagator; } - /** * Returns the owner of this home storage * @return \OC\User\User owner of this home storage diff --git a/lib/private/Files/Storage/Local.php b/lib/private/Files/Storage/Local.php index 4926f84ee91c..b1fa5246bd06 100644 --- a/lib/private/Files/Storage/Local.php +++ b/lib/private/Files/Storage/Local.php @@ -38,7 +38,6 @@ use OCP\Files\ForbiddenException; - /** * for local filestore, we only have to map the paths */ diff --git a/lib/private/Files/Storage/Storage.php b/lib/private/Files/Storage/Storage.php index 643dd61bcefb..de39d00e9459 100644 --- a/lib/private/Files/Storage/Storage.php +++ b/lib/private/Files/Storage/Storage.php @@ -49,7 +49,6 @@ public function getCache($path = '', $storage = null); */ public function getScanner($path = '', $storage = null); - /** * get the user id of the owner of a file or folder * diff --git a/lib/private/Files/Storage/Wrapper/DirMask.php b/lib/private/Files/Storage/Wrapper/DirMask.php index a70343302330..934c9da215a7 100644 --- a/lib/private/Files/Storage/Wrapper/DirMask.php +++ b/lib/private/Files/Storage/Wrapper/DirMask.php @@ -21,7 +21,6 @@ namespace OC\Files\Storage\Wrapper; - /** * While PermissionMask can mask a whole storage this can * mask a certain directory inside a storage diff --git a/lib/private/Files/Storage/Wrapper/Encryption.php b/lib/private/Files/Storage/Wrapper/Encryption.php index 43c16fad969d..e57e1a553d74 100644 --- a/lib/private/Files/Storage/Wrapper/Encryption.php +++ b/lib/private/Files/Storage/Wrapper/Encryption.php @@ -492,7 +492,6 @@ public function fopen($path, $mode) { return $this->storage->fopen($path, $mode); } - /** * perform some plausibility checks if the the unencrypted size is correct. * If not, we calculate the correct unencrypted size and return it diff --git a/lib/private/Files/Storage/Wrapper/ReadOnlyJail.php b/lib/private/Files/Storage/Wrapper/ReadOnlyJail.php index 39cabc4772b3..7962b71a7f99 100644 --- a/lib/private/Files/Storage/Wrapper/ReadOnlyJail.php +++ b/lib/private/Files/Storage/Wrapper/ReadOnlyJail.php @@ -38,7 +38,6 @@ protected function checkPath($path) { return parent::checkPath($path); } - /** * @param string $path * @return bool @@ -67,7 +66,6 @@ public function mkdir($path) { return $result; } - /** * get a cache instance for the storage * diff --git a/lib/private/Files/Storage/Wrapper/Wrapper.php b/lib/private/Files/Storage/Wrapper/Wrapper.php index 31dd7cff7e62..50cf0fad69e4 100644 --- a/lib/private/Files/Storage/Wrapper/Wrapper.php +++ b/lib/private/Files/Storage/Wrapper/Wrapper.php @@ -402,7 +402,6 @@ public function getScanner($path = '', $storage = null) { return $this->getWrapperStorage()->getScanner($path, $storage); } - /** * get the user id of the owner of a file or folder * diff --git a/lib/private/Files/Stream/Checksum.php b/lib/private/Files/Stream/Checksum.php index 868304048385..d506e0387d7b 100644 --- a/lib/private/Files/Stream/Checksum.php +++ b/lib/private/Files/Stream/Checksum.php @@ -22,7 +22,6 @@ namespace OC\Files\Stream; - use Icewind\Streams\Wrapper; use OC\Cache\CappedMemoryCache; @@ -50,7 +49,6 @@ class Checksum extends Wrapper { /** @var CappedMemoryCache Key is path, value is array of checksums */ private static $checksums; - public function __construct(array $algos = ['sha1', 'md5', 'adler32']) { foreach ($algos as $algo) { @@ -62,7 +60,6 @@ public function __construct(array $algos = ['sha1', 'md5', 'adler32']) { } } - /** * @param $source * @param $path @@ -81,7 +78,6 @@ public static function wrap($source, $path) { ); } - /** * @param string $path * @param array $options diff --git a/lib/private/Files/Stream/Encryption.php b/lib/private/Files/Stream/Encryption.php index 1ebdb87bb373..a1d3f0c5fed9 100644 --- a/lib/private/Files/Stream/Encryption.php +++ b/lib/private/Files/Stream/Encryption.php @@ -120,7 +120,6 @@ public function __construct() { ]; } - /** * Wraps a stream with the provided callbacks * diff --git a/lib/private/Files/View.php b/lib/private/Files/View.php index beb15ce63e09..d64220084524 100644 --- a/lib/private/Files/View.php +++ b/lib/private/Files/View.php @@ -43,7 +43,6 @@ * */ - namespace OC\Files; use Icewind\Streams\CallbackWrapper; @@ -105,7 +104,6 @@ class View { private $eventDispatcher; - /** * @param string $root * @throws \Exception If $root contains an invalid path @@ -1091,7 +1089,6 @@ public function fromTmpFile($tmpFile, $path) { } } - /** * @param string $path * @return mixed diff --git a/lib/private/Http/Client/Client.php b/lib/private/Http/Client/Client.php index 9a3ea2d97b14..f4b76aca6efb 100644 --- a/lib/private/Http/Client/Client.php +++ b/lib/private/Http/Client/Client.php @@ -273,7 +273,6 @@ public function delete($uri, array $options = []) { return new Response($response); } - /** * Sends a options request * diff --git a/lib/private/Installer.php b/lib/private/Installer.php index 6094640d053a..60126e0a58c0 100644 --- a/lib/private/Installer.php +++ b/lib/private/Installer.php @@ -474,7 +474,6 @@ protected static function getShippedApps() { } } - // Fix the order - make files first $shippedApps = \array_diff($shippedApps,['files', 'dav']); \array_unshift($shippedApps, 'dav'); diff --git a/lib/private/IntegrityCheck/Iterator/ExcludeFileByNameFilterIterator.php b/lib/private/IntegrityCheck/Iterator/ExcludeFileByNameFilterIterator.php index 160c553821f1..bff18b8e1d38 100644 --- a/lib/private/IntegrityCheck/Iterator/ExcludeFileByNameFilterIterator.php +++ b/lib/private/IntegrityCheck/Iterator/ExcludeFileByNameFilterIterator.php @@ -65,7 +65,6 @@ class ExcludeFileByNameFilterIterator extends \RecursiveFilterIterator { '|/core/js/mimetypelist.js$|', // this file can be regenerated with additional entries with occ maintenance:mimetype:update-js ]; - /** * @return bool */ diff --git a/lib/private/L10N/Factory.php b/lib/private/L10N/Factory.php index e5ad91be0d5d..a762550e7a6f 100644 --- a/lib/private/L10N/Factory.php +++ b/lib/private/L10N/Factory.php @@ -34,7 +34,6 @@ use OCP\Theme\ITheme; use OCP\Theme\IThemeService; - /** * A factory that generates language instances */ diff --git a/lib/private/L10N/L10NString.php b/lib/private/L10N/L10NString.php index 6a0dfa8489a4..9ef6633e719b 100644 --- a/lib/private/L10N/L10NString.php +++ b/lib/private/L10N/L10NString.php @@ -72,7 +72,6 @@ public function __toString() { return \vsprintf($text, $this->parameters); } - public function jsonSerialize() { return $this->__toString(); } diff --git a/lib/private/Log.php b/lib/private/Log.php index 933779055a9b..b38bf2a29815 100644 --- a/lib/private/Log.php +++ b/lib/private/Log.php @@ -219,7 +219,6 @@ public function debug($message, array $context = []) { $this->log(Util::DEBUG, $message, $context); } - /** * Logs with an arbitrary level. * diff --git a/lib/private/Log/Errorlog.php b/lib/private/Log/Errorlog.php index c4d4fb466eb4..8d95bdf9997c 100644 --- a/lib/private/Log/Errorlog.php +++ b/lib/private/Log/Errorlog.php @@ -27,7 +27,6 @@ class Errorlog { - /** * Init class data */ diff --git a/lib/private/Migration/ConsoleOutput.php b/lib/private/Migration/ConsoleOutput.php index 7f90707bb649..4a6e572aa5f3 100644 --- a/lib/private/Migration/ConsoleOutput.php +++ b/lib/private/Migration/ConsoleOutput.php @@ -19,10 +19,8 @@ * */ - namespace OC\Migration; - use OCP\Migration\IOutput; use Symfony\Component\Console\Helper\ProgressBar; use Symfony\Component\Console\Output\OutputInterface; diff --git a/lib/private/Migration/SimpleOutput.php b/lib/private/Migration/SimpleOutput.php index e2e5f928d202..00678245e96f 100644 --- a/lib/private/Migration/SimpleOutput.php +++ b/lib/private/Migration/SimpleOutput.php @@ -19,10 +19,8 @@ * */ - namespace OC\Migration; - use OCP\ILogger; use OCP\Migration\IOutput; diff --git a/lib/private/Notification/Action.php b/lib/private/Notification/Action.php index ea84e1becb92..ba96f7a8881a 100644 --- a/lib/private/Notification/Action.php +++ b/lib/private/Notification/Action.php @@ -21,7 +21,6 @@ namespace OC\Notification; - use OCP\Notification\IAction; class Action implements IAction { diff --git a/lib/private/Notification/Notification.php b/lib/private/Notification/Notification.php index a4552c08dc42..90fd64e41548 100644 --- a/lib/private/Notification/Notification.php +++ b/lib/private/Notification/Notification.php @@ -22,7 +22,6 @@ namespace OC\Notification; - use OCP\Notification\IAction; use OCP\Notification\INotification; diff --git a/lib/private/Preview/Bitmap.php b/lib/private/Preview/Bitmap.php index ed1ab4190643..9e2f7c8d5061 100644 --- a/lib/private/Preview/Bitmap.php +++ b/lib/private/Preview/Bitmap.php @@ -53,7 +53,6 @@ public function getThumbnail(File $file, $maxX, $maxY, $scalingUp) { \fclose($stream); } - //new bitmap image object $image = new \OC_Image(); $image->loadFromData($bp); diff --git a/lib/private/Repair/DisableExtraThemes.php b/lib/private/Repair/DisableExtraThemes.php index 2d60ea44ca9f..88e7ba66280d 100644 --- a/lib/private/Repair/DisableExtraThemes.php +++ b/lib/private/Repair/DisableExtraThemes.php @@ -21,7 +21,6 @@ namespace OC\Repair; - use OCP\App\IAppManager; use OCP\IAppConfig; use OCP\IConfig; diff --git a/lib/private/Repair/DropOldJobs.php b/lib/private/Repair/DropOldJobs.php index df52ba4878db..de92271564b5 100644 --- a/lib/private/Repair/DropOldJobs.php +++ b/lib/private/Repair/DropOldJobs.php @@ -83,5 +83,4 @@ public function oldJobs() { ]; } - } diff --git a/lib/private/Repair/DropOldTables.php b/lib/private/Repair/DropOldTables.php index 8f7d265eac20..d4f9d7a105c4 100644 --- a/lib/private/Repair/DropOldTables.php +++ b/lib/private/Repair/DropOldTables.php @@ -23,7 +23,6 @@ namespace OC\Repair; - use OCP\IDBConnection; use OCP\Migration\IOutput; use OCP\Migration\IRepairStep; diff --git a/lib/private/Repair/RepairInvalidShares.php b/lib/private/Repair/RepairInvalidShares.php index 545762c7b0f2..2523e8d4f36a 100644 --- a/lib/private/Repair/RepairInvalidShares.php +++ b/lib/private/Repair/RepairInvalidShares.php @@ -98,7 +98,6 @@ private function adjustFileSharePermissions(IOutput $out) { $mask = \OCP\Constants::PERMISSION_READ | \OCP\Constants::PERMISSION_UPDATE | \OCP\Constants::PERMISSION_SHARE; $builder = $this->connection->getQueryBuilder(); - if ($this->connection->getDatabasePlatform() instanceof OraclePlatform) { $permsFunc = $builder->createFunction( 'bitand(' . $builder->getColumnName('permissions') . ', ' . $mask . ')' diff --git a/lib/private/Repair/RepairMimeTypes.php b/lib/private/Repair/RepairMimeTypes.php index 009f0e77654d..08b17f5b4ee5 100644 --- a/lib/private/Repair/RepairMimeTypes.php +++ b/lib/private/Repair/RepairMimeTypes.php @@ -170,7 +170,6 @@ private function fixOfficeMimeTypes() { 'pptx' => 'application/vnd.openxmlformats-officedocument.presentationml.presentation', ]; - // separate doc from docx etc self::updateMimetypes($updatedMimetypes); diff --git a/lib/private/Repair/RepairMismatchFileCachePath.php b/lib/private/Repair/RepairMismatchFileCachePath.php index e49e27a58c1d..4445ed7c04b3 100644 --- a/lib/private/Repair/RepairMismatchFileCachePath.php +++ b/lib/private/Repair/RepairMismatchFileCachePath.php @@ -221,7 +221,6 @@ private function countResultsToProcessNonExistingParentIdEntry($storageNumericId return $count; } - /** * Outputs a report about storages with wrong path that need repairing in the file cache */ diff --git a/lib/private/Route/Router.php b/lib/private/Route/Router.php index 6a72648ba80b..f86647223b99 100644 --- a/lib/private/Route/Router.php +++ b/lib/private/Route/Router.php @@ -396,7 +396,6 @@ private function requireRouteFile($file, $appName) { $this->setupRoutes(include_once $file, $appName); } - /** * If a routes.php file returns an array, try to set up the application and * register the routes for the app. The application class will be chosen by diff --git a/lib/private/Security/Crypto.php b/lib/private/Security/Crypto.php index d21ff23bda46..591cb208c5bd 100644 --- a/lib/private/Security/Crypto.php +++ b/lib/private/Security/Crypto.php @@ -22,7 +22,6 @@ * */ - namespace OC\Security; use phpseclib\Crypt\AES; diff --git a/lib/private/Security/Hasher.php b/lib/private/Security/Hasher.php index ffdf79e17b43..a0a2ff06892b 100644 --- a/lib/private/Security/Hasher.php +++ b/lib/private/Security/Hasher.php @@ -154,7 +154,6 @@ public function verify($message, $hash, &$newHash = null) { return $this->legacyHashVerify($message, $hash, $newHash); } - return false; } diff --git a/lib/private/Server.php b/lib/private/Server.php index e36f7e2b02d3..cb70c3097e79 100644 --- a/lib/private/Server.php +++ b/lib/private/Server.php @@ -966,7 +966,6 @@ public function getSystemTagObjectMapper() { return $this->query('SystemTagObjectMapper'); } - /** * Returns the avatar manager, used for avatar functionality * @@ -1182,7 +1181,6 @@ public function getGetRedisFactory() { return $this->query('RedisFactory'); } - /** * Returns the current session * @@ -1231,7 +1229,6 @@ public function getSettingsManager() { return $this->query('SettingsManager'); } - /** * Returns a router for generating and matching urls * diff --git a/lib/private/ServerContainer.php b/lib/private/ServerContainer.php index ac19d69fba87..33b4ff1e06ba 100644 --- a/lib/private/ServerContainer.php +++ b/lib/private/ServerContainer.php @@ -21,7 +21,6 @@ namespace OC; - use OC\AppFramework\DependencyInjection\DIContainer; use OC\AppFramework\Utility\SimpleContainer; use OCP\AppFramework\QueryException; diff --git a/lib/private/ServerNotAvailableException.php b/lib/private/ServerNotAvailableException.php index ee6e58512313..ef86c3e6929d 100644 --- a/lib/private/ServerNotAvailableException.php +++ b/lib/private/ServerNotAvailableException.php @@ -21,7 +21,6 @@ namespace OC; - class ServerNotAvailableException extends \Exception { } diff --git a/lib/private/Settings/SettingsManager.php b/lib/private/Settings/SettingsManager.php index 31cd12807793..922ce4b1e7bf 100644 --- a/lib/private/Settings/SettingsManager.php +++ b/lib/private/Settings/SettingsManager.php @@ -309,7 +309,6 @@ public function getPanelsList($type) { return \array_merge($this->findRegisteredPanels($type), $this->getBuiltInPanels($type)); } - /** * Searches through the currently enabled apps and returns the panels registered * @param string $type the type of panels to return diff --git a/lib/private/Share/Helper.php b/lib/private/Share/Helper.php index f82f1f44e050..1d74057d6824 100644 --- a/lib/private/Share/Helper.php +++ b/lib/private/Share/Helper.php @@ -202,7 +202,6 @@ public static function calculateExpireDate($defaultExpireSettings, $creationTime $defaultExpires = $creationTime + $defaultExpireSettings['expireAfterDays'] * 86400; } - if (isset($userExpireDate)) { // if the admin decided to enforce the default expire date then we only take // the user defined expire date of it is before the default expire date diff --git a/lib/private/Share/Share.php b/lib/private/Share/Share.php index 7ca360aa67f0..5a6dc3ec4071 100644 --- a/lib/private/Share/Share.php +++ b/lib/private/Share/Share.php @@ -151,7 +151,6 @@ public static function getUsersSharingFile($path, $ownerUser, $includeOwner = fa throw new \OC\User\NoUserException($msg); } - $ownerUser = $userObject->getUID(); Filesystem::initMountPoints($ownerUser); @@ -570,7 +569,6 @@ public static function resolveReShare($linkItem) return $linkItem; } - /** * Get the shared items of item type owned by the current user * @param string $itemType @@ -1488,12 +1486,10 @@ protected static function expireItem(array $item) { $expires = null; } - // get default expiration settings $defaultSettings = Helper::getDefaultExpireSetting(); $expires = Helper::calculateExpireDate($defaultSettings, $item['stime'], $expires); - if (\is_int($expires)) { $now = \time(); if ($now > $expires) { @@ -2335,7 +2331,6 @@ private static function put($itemType, $itemSource, $shareType, $shareWith, $uid \OC_Hook::emit('OCP\Share', 'post_shared', $postHookData); - return $id ? $id : false; } @@ -2573,7 +2568,6 @@ private static function createSelectStatement($format, $fileDependent, $uidOwner return $select; } - /** * transform db results * @param array $row result diff --git a/lib/private/Share20/Exception/ProviderException.php b/lib/private/Share20/Exception/ProviderException.php index 2c80381701cc..839225d739e5 100644 --- a/lib/private/Share20/Exception/ProviderException.php +++ b/lib/private/Share20/Exception/ProviderException.php @@ -20,7 +20,6 @@ */ namespace OC\Share20\Exception; - class ProviderException extends \Exception { } diff --git a/lib/private/Share20/Manager.php b/lib/private/Share20/Manager.php index 3b69bc545ae6..4a791fd31f84 100644 --- a/lib/private/Share20/Manager.php +++ b/lib/private/Share20/Manager.php @@ -77,7 +77,6 @@ class Manager implements IManager { /** @var EventDispatcher */ private $eventDispatcher; - /** * Manager constructor. * @@ -895,7 +894,6 @@ public function deleteShare(\OCP\Share\IShare $share) { $this->eventDispatcher->dispatch('share.afterDelete', $afterEvent); } - /** * Unshare a file as the recipient. * This can be different from a regular delete for example when one of @@ -1073,7 +1071,6 @@ public function getSharedWith($userId, $shareType, $node = null, $limit = 50, $o return $provider->getSharedWith($userId, $shareType, $node, $limit, $offset); } - /** * @inheritdoc */ diff --git a/lib/private/SystemConfig.php b/lib/private/SystemConfig.php index 8712f2e73f0c..74b6b192013d 100644 --- a/lib/private/SystemConfig.php +++ b/lib/private/SystemConfig.php @@ -25,7 +25,6 @@ namespace OC; - use OCP\IConfig; /** diff --git a/lib/private/Updater/VersionCheck.php b/lib/private/Updater/VersionCheck.php index 2c61697fc44e..3b5bf86f9848 100644 --- a/lib/private/Updater/VersionCheck.php +++ b/lib/private/Updater/VersionCheck.php @@ -44,7 +44,6 @@ public function __construct(IClientService $clientService, $this->config = $config; } - /** * Check if a new version is available * diff --git a/lib/private/User/Account.php b/lib/private/User/Account.php index 569af6c6664d..0c73cf21340a 100644 --- a/lib/private/User/Account.php +++ b/lib/private/User/Account.php @@ -19,7 +19,6 @@ * */ - namespace OC\User; use OCP\AppFramework\Db\Entity; diff --git a/lib/private/User/AccountMapper.php b/lib/private/User/AccountMapper.php index a9ce0e9cf945..75c6047e8f5f 100644 --- a/lib/private/User/AccountMapper.php +++ b/lib/private/User/AccountMapper.php @@ -23,7 +23,6 @@ namespace OC\User; - use OC\DB\QueryBuilder\Literal; use OCP\AppFramework\Db\DoesNotExistException; use OCP\AppFramework\Db\Entity; diff --git a/lib/private/User/AccountTerm.php b/lib/private/User/AccountTerm.php index 6741e080b830..d8957a92743b 100644 --- a/lib/private/User/AccountTerm.php +++ b/lib/private/User/AccountTerm.php @@ -22,7 +22,6 @@ namespace OC\User; - use OCP\AppFramework\Db\Entity; /** diff --git a/lib/private/User/AccountTermMapper.php b/lib/private/User/AccountTermMapper.php index 079e77815164..c15e488fa8b3 100644 --- a/lib/private/User/AccountTermMapper.php +++ b/lib/private/User/AccountTermMapper.php @@ -22,7 +22,6 @@ namespace OC\User; - use OCP\AppFramework\Db\Mapper; use OCP\IDBConnection; diff --git a/lib/private/User/BasicAuthModule.php b/lib/private/User/BasicAuthModule.php index e47c9f537ad1..0a0c19258bef 100644 --- a/lib/private/User/BasicAuthModule.php +++ b/lib/private/User/BasicAuthModule.php @@ -20,10 +20,8 @@ * */ - namespace OC\User; - use OCP\AppFramework\Utility\ITimeFactory; use OCP\Authentication\IAuthModule; use OCP\IConfig; @@ -35,7 +33,6 @@ class BasicAuthModule implements IAuthModule { - /** @var IConfig */ private $config; /** @var ILogger */ diff --git a/lib/private/User/Manager.php b/lib/private/User/Manager.php index 2b805fe567c5..e82c39765162 100644 --- a/lib/private/User/Manager.php +++ b/lib/private/User/Manager.php @@ -369,7 +369,6 @@ public function createUser($uid, $password) { } } - return false; }, ['before' => ['uid' => $uid], 'after' => ['uid' => $uid, 'password' => $password]], 'user', 'create'); } diff --git a/lib/private/User/RemoteUser.php b/lib/private/User/RemoteUser.php index beabb20b7697..37801e9d4308 100644 --- a/lib/private/User/RemoteUser.php +++ b/lib/private/User/RemoteUser.php @@ -19,10 +19,8 @@ * */ - namespace OC\User; - use OCP\IUser; /** diff --git a/lib/private/User/Session.php b/lib/private/User/Session.php index edbabb920bb6..d067a0137890 100644 --- a/lib/private/User/Session.php +++ b/lib/private/User/Session.php @@ -970,7 +970,6 @@ public function unsetMagicInCookie() { unset($_COOKIE['oc_username'], $_COOKIE['oc_token'], $_COOKIE['oc_remember_login']); //TODO: DI - \setcookie('oc_username', '', \time() - 3600, OC::$WEBROOT, '', $secureCookie, true); \setcookie('oc_token', '', \time() - 3600, OC::$WEBROOT, '', $secureCookie, true); \setcookie('oc_remember_login', '', \time() - 3600, OC::$WEBROOT, '', $secureCookie, true); diff --git a/lib/private/User/Sync/UsersIterator.php b/lib/private/User/Sync/UsersIterator.php index a090e9d43af7..369b6575f2e5 100644 --- a/lib/private/User/Sync/UsersIterator.php +++ b/lib/private/User/Sync/UsersIterator.php @@ -27,7 +27,6 @@ abstract class UsersIterator implements \Iterator { const LIMIT = 500; - public function rewind() { $this->position = 0; $this->page = 0; diff --git a/lib/private/User/SyncService.php b/lib/private/User/SyncService.php index 4809dd33d3b0..bdb6a238efba 100644 --- a/lib/private/User/SyncService.php +++ b/lib/private/User/SyncService.php @@ -330,7 +330,6 @@ public function createOrSyncAccount($uid, UserInterface $backend) { throw new \Exception("The database returned multiple accounts for this uid: $uid"); } - // The account exists, sync $account = $this->syncAccount($account, $backend); if($account->getId() === null) { diff --git a/lib/private/User/TokenAuthModule.php b/lib/private/User/TokenAuthModule.php index 5089a5e759f9..0fb8ed9e9848 100644 --- a/lib/private/User/TokenAuthModule.php +++ b/lib/private/User/TokenAuthModule.php @@ -19,10 +19,8 @@ * */ - namespace OC\User; - use OC\Authentication\Exceptions\InvalidTokenException; use OC\Authentication\Exceptions\PasswordlessTokenException; use OC\Authentication\Token\IProvider; diff --git a/lib/private/legacy/filechunking.php b/lib/private/legacy/filechunking.php index 3d455b91c521..1a427efe2038 100644 --- a/lib/private/legacy/filechunking.php +++ b/lib/private/legacy/filechunking.php @@ -27,7 +27,6 @@ * */ - class OC_FileChunking { protected $info; protected $cache; diff --git a/lib/private/legacy/files.php b/lib/private/legacy/files.php index c6c4e6895a08..99276c8ab278 100644 --- a/lib/private/legacy/files.php +++ b/lib/private/legacy/files.php @@ -51,7 +51,6 @@ class OC_Files { const UPLOAD_MIN_LIMIT_BYTES = 1048576; // 1 MiB - private static $multipartBoundary = ''; /** diff --git a/lib/private/legacy/json.php b/lib/private/legacy/json.php index f1686870548d..c2912260a962 100644 --- a/lib/private/legacy/json.php +++ b/lib/private/legacy/json.php @@ -120,7 +120,6 @@ public static function checkUserExists($user) { } } - /** * Check if the user has administration privileges, send json error msg if not * @deprecated Use annotation based ACLs from the AppFramework instead diff --git a/lib/private/legacy/template.php b/lib/private/legacy/template.php index 6fd2f6061a6a..6db3612e6d57 100644 --- a/lib/private/legacy/template.php +++ b/lib/private/legacy/template.php @@ -177,7 +177,6 @@ public static function initTemplateEngine($renderAs) { } - /** * find the template with the given name * @param string $name of the template file (without suffix) diff --git a/lib/private/legacy/user.php b/lib/private/legacy/user.php index 9764e47d472e..61be814a7ae0 100644 --- a/lib/private/legacy/user.php +++ b/lib/private/legacy/user.php @@ -204,7 +204,6 @@ public static function handleApacheAuth() { return null; } - /** * Sets user id for session and triggers emit * @@ -303,7 +302,6 @@ public static function isAdminUser($uid) { return false; } - /** * get the user id of the user currently logged in. * diff --git a/lib/private/legacy/util.php b/lib/private/legacy/util.php index 0cf4bc42562f..6acf7af12f83 100644 --- a/lib/private/legacy/util.php +++ b/lib/private/legacy/util.php @@ -191,7 +191,6 @@ public static function setupFS($user = '') { }, 1); - \OC\Files\Filesystem::addStorageWrapper('oc_encoding', function ($mountPoint, \OCP\Files\Storage $storage, \OCP\Files\Mount\IMountPoint $mount) { if ($mount->getOption('encoding_compatibility', false) && !$storage->instanceOfStorage('\OCA\Files_Sharing\SharedStorage') && !$storage->isLocal()) { return new \OC\Files\Storage\Wrapper\Encoding(['storage' => $storage]); @@ -245,7 +244,6 @@ public static function setupFS($user = '') { $readOnlyGroups = []; } - $userGroups = \array_keys( \OC::$server->getGroupManager()->getUserIdGroups($user) ); @@ -256,7 +254,6 @@ public static function setupFS($user = '') { ); } - if ($isGuest === '1' || !empty($readOnlyGroupMemberships)) { \OC\Files\Filesystem::addStorageWrapper( 'oc_readonly', @@ -1195,7 +1192,6 @@ public static function encodePath($component) { return $encoded; } - public function createHtaccessTestFile(\OCP\IConfig $config) { // php dev server does not support htaccess if (\php_sapi_name() === 'cli-server') { diff --git a/lib/public/Activity/IManager.php b/lib/public/Activity/IManager.php index 3cb41faddba1..72dc999f53da 100644 --- a/lib/public/Activity/IManager.php +++ b/lib/public/Activity/IManager.php @@ -204,7 +204,6 @@ public function filterNotificationTypes($types, $filter); */ public function getQueryForFilter($filter); - /** * Set the user we need to use * diff --git a/lib/public/App/IServiceLoader.php b/lib/public/App/IServiceLoader.php index 29da75de0d99..43171bc92a9a 100644 --- a/lib/public/App/IServiceLoader.php +++ b/lib/public/App/IServiceLoader.php @@ -19,7 +19,6 @@ * */ - namespace OCP\App; use OCP\IUser; diff --git a/lib/public/AppFramework/ApiController.php b/lib/public/AppFramework/ApiController.php index 505b3474f979..2997a4cc8013 100644 --- a/lib/public/AppFramework/ApiController.php +++ b/lib/public/AppFramework/ApiController.php @@ -31,7 +31,6 @@ use OCP\AppFramework\Http\Response; use OCP\IRequest; - /** * Base class to inherit your controllers from that are used for RESTful APIs * @since 7.0.0 @@ -67,7 +66,6 @@ public function __construct($appName, $this->corsMaxAge = $corsMaxAge; } - /** * This method implements a preflighted cors response for you that you can * link to for the options request @@ -93,5 +91,4 @@ public function preflightedCors() { return $response; } - } diff --git a/lib/public/AppFramework/App.php b/lib/public/AppFramework/App.php index 699be60d1d46..b50b9e13ecc0 100644 --- a/lib/public/AppFramework/App.php +++ b/lib/public/AppFramework/App.php @@ -32,7 +32,6 @@ namespace OCP\AppFramework; use OC\AppFramework\Routing\RouteConfig; - /** * Class App * @package OCP\AppFramework @@ -43,7 +42,6 @@ */ class App { - /** * Turns an app id into a namespace by convetion. The id is split at the * underscores, all parts are camelcased and reassembled. e.g.: @@ -58,7 +56,6 @@ public static function buildAppNamespace($appId, $topNamespace='OCA\\') { return \OC\AppFramework\App::buildAppNamespace($appId, $topNamespace); } - /** * @param array $urlParams an array with variables extracted from the routes * @since 6.0.0 diff --git a/lib/public/AppFramework/Controller.php b/lib/public/AppFramework/Controller.php index 1ed211f403dd..f4db3dd7c606 100644 --- a/lib/public/AppFramework/Controller.php +++ b/lib/public/AppFramework/Controller.php @@ -37,7 +37,6 @@ use OCP\AppFramework\Http\Response; use OCP\IRequest; - /** * Base class to inherit your controllers from * @since 6.0.0 @@ -98,7 +97,6 @@ public function __construct($appName, ]; } - /** * Parses an HTTP accept header and returns the supported responder type * @param string $acceptHeader @@ -123,7 +121,6 @@ public function getResponderByHTTPHeader($acceptHeader) { return 'json'; } - /** * Registers a formatter for a type * @param string $format @@ -134,7 +131,6 @@ protected function registerResponder($format, \Closure $responder) { $this->responders[$format] = $responder; } - /** * Serializes and formats a response * @param mixed $response the value that was returned from a controller and @@ -157,7 +153,6 @@ public function buildResponse($response, $format='json') { } } - /** * Lets you access post and get parameters by the index * @deprecated 7.0.0 write your parameters as method arguments instead @@ -175,7 +170,6 @@ public function params($key, $default=null){ return $this->request->getParam($key, $default); } - /** * Returns all params that were received, be it from the request * (as GET or POST) or through the URL by the route @@ -187,7 +181,6 @@ public function getParams() { return $this->request->getParams(); } - /** * Returns the method of the request * @deprecated 7.0.0 use $this->request instead @@ -198,7 +191,6 @@ public function method() { return $this->request->getMethod(); } - /** * Shortcut for accessing an uploaded file through the $_FILES array * @deprecated 7.0.0 use $this->request instead @@ -210,7 +202,6 @@ public function getUploadedFile($key) { return $this->request->getUploadedFile($key); } - /** * Shortcut for getting env variables * @deprecated 7.0.0 use $this->request instead @@ -222,7 +213,6 @@ public function env($key) { return $this->request->getEnv($key); } - /** * Shortcut for getting cookie variables * @deprecated 7.0.0 use $this->request instead @@ -234,7 +224,6 @@ public function cookie($key) { return $this->request->getCookie($key); } - /** * Shortcut for rendering a template * @deprecated 7.0.0 return a template response instead @@ -259,5 +248,4 @@ public function render($templateName, array $params= [], return $response; } - } diff --git a/lib/public/AppFramework/Db/DoesNotExistException.php b/lib/public/AppFramework/Db/DoesNotExistException.php index 8f657883c237..9c2fdfb48cec 100644 --- a/lib/public/AppFramework/Db/DoesNotExistException.php +++ b/lib/public/AppFramework/Db/DoesNotExistException.php @@ -20,10 +20,8 @@ * */ - namespace OCP\AppFramework\Db; - /** * This is returned or should be returned when a find request does not find an * entry in the database diff --git a/lib/public/AppFramework/Db/Entity.php b/lib/public/AppFramework/Db/Entity.php index ddbe54d14b28..b923af6d71be 100644 --- a/lib/public/AppFramework/Db/Entity.php +++ b/lib/public/AppFramework/Db/Entity.php @@ -23,7 +23,6 @@ namespace OCP\AppFramework\Db; - /** * @method integer getId() * @method void setId(integer $id) @@ -36,7 +35,6 @@ abstract class Entity { private $_updatedFields = []; private $_fieldTypes = ['id' => 'integer']; - /** * Simple alternative constructor for building entities from a request * @param array $params the array which was obtained via $this->params('key') @@ -55,7 +53,6 @@ public static function fromParams(array $params) { return $instance; } - /** * Maps the keys of the row array to the attributes * @param array $row the row to map onto the entity @@ -75,7 +72,6 @@ public static function fromRow(array $row){ return $instance; } - /** * @return array with attribute and type * @since 7.0.0 @@ -84,7 +80,6 @@ public function getFieldTypes() { return $this->_fieldTypes; } - /** * Marks the entity as clean needed for setting the id after the insertion * @since 7.0.0 @@ -131,7 +126,6 @@ protected function getter($name) { } } - /** * Each time a setter is called, push the part after set * into an array: for instance setId will save Id in the @@ -153,7 +147,6 @@ public function __call($methodName, $args){ } - /** * Mark am attribute as updated * @param string $attribute the name of the attribute @@ -163,7 +156,6 @@ protected function markFieldUpdated($attribute){ $this->_updatedFields[$attribute] = true; } - /** * Transform a database columnname to a property * @param string $columnName the name of the column @@ -185,7 +177,6 @@ public function columnToProperty($columnName){ return $property; } - /** * Transform a property to a database column name * @param string $property the name of the property @@ -207,7 +198,6 @@ public function propertyToColumn($property){ return $column; } - /** * @return array array of updated fields for update query * @since 7.0.0 @@ -216,7 +206,6 @@ public function getUpdatedFields(){ return $this->_updatedFields; } - /** * Adds type information for a field so that its automatically casted to * that value once its being returned from the database @@ -228,7 +217,6 @@ protected function addType($fieldName, $type){ $this->_fieldTypes[$fieldName] = $type; } - /** * Slugify the value of a given attribute * Warning: This doesn't result in a unique value diff --git a/lib/public/AppFramework/Db/Mapper.php b/lib/public/AppFramework/Db/Mapper.php index d656524da45a..4aeae3311fc1 100644 --- a/lib/public/AppFramework/Db/Mapper.php +++ b/lib/public/AppFramework/Db/Mapper.php @@ -23,14 +23,12 @@ * */ - namespace OCP\AppFramework\Db; use OCP\DB\QueryBuilder\IQueryBuilder; use OCP\IDBConnection; use OCP\IDb; - /** * Simple parent class for inheriting your data access layer from. This class * may be subject to change in the future @@ -62,7 +60,6 @@ public function __construct(IDBConnection $db, $tableName, $entityClass=null){ } } - /** * @return string the table name * @since 7.0.0 @@ -71,7 +68,6 @@ public function getTableName(){ return $this->tableName; } - /** * Deletes an entity from the table * @param Entity $entity the entity that should be deleted @@ -85,7 +81,6 @@ public function delete(Entity $entity){ return $entity; } - /** * Creates a new entry in the db from an entity * @param Entity $entity the entity that should be created @@ -132,8 +127,6 @@ public function insert(Entity $entity){ return $entity; } - - /** * Updates an entry in the db from an entity * @throws \InvalidArgumentException if entity has no id @@ -218,7 +211,6 @@ private function getPDOType($value) { } } - /** * Runs an sql query * @param string $sql the prepare string @@ -263,7 +255,6 @@ protected function execute($sql, array $params=[], $limit=null, $offset=null) { return $query; } - /** * Returns an db result and throws exceptions when there are more or less * results @@ -325,7 +316,6 @@ private function buildDebugMessage($msg, $sql, array $params=[], $limit=null, $o 'offset "' . $offset . '"'; } - /** * Creates an entity from a row. Automatically determines the entity class * from the current mapper name (MyEntityMapper -> MyEntity) @@ -338,7 +328,6 @@ protected function mapRowToEntity($row) { return \call_user_func($this->entityClass .'::fromRow', $row); } - /** * Runs a sql query and returns an array of entities * @param string $sql the prepare string @@ -362,7 +351,6 @@ protected function findEntities($sql, array $params=[], $limit=null, $offset=nul return $entities; } - /** * Returns an db result and throws exceptions when there are more or less * results @@ -379,5 +367,4 @@ protected function findEntity($sql, array $params=[], $limit=null, $offset=null) return $this->mapRowToEntity($this->findOneQuery($sql, $params, $limit, $offset)); } - } diff --git a/lib/public/AppFramework/Db/MultipleObjectsReturnedException.php b/lib/public/AppFramework/Db/MultipleObjectsReturnedException.php index 24e1f215d740..399195303eac 100644 --- a/lib/public/AppFramework/Db/MultipleObjectsReturnedException.php +++ b/lib/public/AppFramework/Db/MultipleObjectsReturnedException.php @@ -20,10 +20,8 @@ * */ - namespace OCP\AppFramework\Db; - /** * This is returned or should be returned when a find request finds more than one * row diff --git a/lib/public/AppFramework/Http/DataDisplayResponse.php b/lib/public/AppFramework/Http/DataDisplayResponse.php index 7302094bf2d6..a9cfbc74f3c5 100644 --- a/lib/public/AppFramework/Http/DataDisplayResponse.php +++ b/lib/public/AppFramework/Http/DataDisplayResponse.php @@ -38,7 +38,6 @@ class DataDisplayResponse extends Response { */ protected $data; - /** * @param string $data the data to display * @param int $statusCode the Http status code, defaults to 200 @@ -62,7 +61,6 @@ public function render() { return $this->data; } - /** * Sets values in the data * @param string $data the data to display @@ -75,7 +73,6 @@ public function setData($data){ return $this; } - /** * Used to get the set parameters * @return string the data diff --git a/lib/public/AppFramework/Http/DataResponse.php b/lib/public/AppFramework/Http/DataResponse.php index d2e2b490a7a2..bf6916d43260 100644 --- a/lib/public/AppFramework/Http/DataResponse.php +++ b/lib/public/AppFramework/Http/DataResponse.php @@ -43,7 +43,6 @@ class DataResponse extends Response { */ protected $data; - /** * @param array|object $data the object or array that should be transformed * @param int $statusCode the Http status code, defaults to 200 @@ -57,7 +56,6 @@ public function __construct($data= [], $statusCode=Http::STATUS_OK, $this->setHeaders(\array_merge($this->getHeaders(), $headers)); } - /** * Sets values in the data json array * @param array|object $data an array or object which will be transformed @@ -70,7 +68,6 @@ public function setData($data){ return $this; } - /** * Used to get the set parameters * @return array the data @@ -80,5 +77,4 @@ public function getData(){ return $this->data; } - } diff --git a/lib/public/AppFramework/Http/DownloadResponse.php b/lib/public/AppFramework/Http/DownloadResponse.php index edef9c605e8f..2c47f1b816c6 100644 --- a/lib/public/AppFramework/Http/DownloadResponse.php +++ b/lib/public/AppFramework/Http/DownloadResponse.php @@ -21,10 +21,8 @@ * */ - namespace OCP\AppFramework\Http; - /** * Prompts the user to download the a file * @since 7.0.0 @@ -48,5 +46,4 @@ public function __construct($filename, $contentType) { $this->addHeader('Content-Type', $contentType); } - } diff --git a/lib/public/AppFramework/Http/EmptyContentSecurityPolicy.php b/lib/public/AppFramework/Http/EmptyContentSecurityPolicy.php index 9ef8d1166cac..c5068833a000 100644 --- a/lib/public/AppFramework/Http/EmptyContentSecurityPolicy.php +++ b/lib/public/AppFramework/Http/EmptyContentSecurityPolicy.php @@ -22,7 +22,6 @@ namespace OCP\AppFramework\Http; - /** * Class EmptyContentSecurityPolicy is a simple helper which allows applications * to modify the Content-Security-Policy sent by ownCloud. Per default the policy diff --git a/lib/public/AppFramework/Http/ICallbackResponse.php b/lib/public/AppFramework/Http/ICallbackResponse.php index e1070c7b99f6..09a60ec9cadf 100644 --- a/lib/public/AppFramework/Http/ICallbackResponse.php +++ b/lib/public/AppFramework/Http/ICallbackResponse.php @@ -23,7 +23,6 @@ namespace OCP\AppFramework\Http; - /** * Interface ICallbackResponse * diff --git a/lib/public/AppFramework/Http/IOutput.php b/lib/public/AppFramework/Http/IOutput.php index 192a84672ced..52b55140e74b 100644 --- a/lib/public/AppFramework/Http/IOutput.php +++ b/lib/public/AppFramework/Http/IOutput.php @@ -24,7 +24,6 @@ namespace OCP\AppFramework\Http; - /** * Very thin wrapper class to make output testable * @since 8.1.0 diff --git a/lib/public/AppFramework/Http/JSONResponse.php b/lib/public/AppFramework/Http/JSONResponse.php index 82acdf90ffd8..1eda716be78f 100644 --- a/lib/public/AppFramework/Http/JSONResponse.php +++ b/lib/public/AppFramework/Http/JSONResponse.php @@ -45,7 +45,6 @@ class JSONResponse extends Response { */ protected $data; - /** * constructor of JSONResponse * @param array|object $data the object or array that should be transformed @@ -58,7 +57,6 @@ public function __construct($data= [], $statusCode=Http::STATUS_OK) { $this->addHeader('Content-Type', 'application/json; charset=utf-8'); } - /** * Returns the rendered json * @return string|null the rendered json @@ -94,7 +92,6 @@ public function setData($data){ return $this; } - /** * Used to get the set parameters * @return array the data diff --git a/lib/public/AppFramework/Http/RedirectResponse.php b/lib/public/AppFramework/Http/RedirectResponse.php index 8b044b2d474c..b371458fff7f 100644 --- a/lib/public/AppFramework/Http/RedirectResponse.php +++ b/lib/public/AppFramework/Http/RedirectResponse.php @@ -22,12 +22,10 @@ * */ - namespace OCP\AppFramework\Http; use OCP\AppFramework\Http; - /** * Redirects to a different URL * @since 7.0.0 @@ -47,7 +45,6 @@ public function __construct($redirectURL) { $this->addHeader('Location', $redirectURL); } - /** * @return string the url to redirect * @since 7.0.0 @@ -56,5 +53,4 @@ public function getRedirectURL() { return $this->redirectURL; } - } diff --git a/lib/public/AppFramework/Http/Response.php b/lib/public/AppFramework/Http/Response.php index c0f2f895b2d5..8a6ba06f8bed 100644 --- a/lib/public/AppFramework/Http/Response.php +++ b/lib/public/AppFramework/Http/Response.php @@ -49,28 +49,24 @@ class Response { 'Cache-Control' => 'no-cache, must-revalidate' ]; - /** * Cookies that will be need to be constructed as header * @var array */ private $cookies = []; - /** * HTTP status code - defaults to STATUS OK * @var int */ private $status = Http::STATUS_OK; - /** * Last modified date * @var \DateTime */ private $lastModified; - /** * ETag * @var string @@ -80,7 +76,6 @@ class Response { /** @var ContentSecurityPolicy|null Used Content-Security-Policy */ private $contentSecurityPolicy = null; - /** * Caches the response * @param int $cacheSeconds the amount of seconds that should be cached @@ -115,7 +110,6 @@ public function addCookie($name, $value, \DateTime $expireDate = null) { return $this; } - /** * Set the specified cookies * @param array $cookies array('foo' => array('value' => 'bar', 'expire' => null)) @@ -127,7 +121,6 @@ public function setCookies(array $cookies) { return $this; } - /** * Invalidates the specified cookie * @param string $name @@ -183,7 +176,6 @@ public function addHeader($name, $value) { return $this; } - /** * Set the headers * @param array $headers value header pairs @@ -196,7 +188,6 @@ public function setHeaders(array $headers) { return $this; } - /** * Returns the set headers * @return array the headers @@ -223,7 +214,6 @@ public function getHeaders() { return \array_merge($mergeWith, $this->headers); } - /** * By default renders no output * @return null @@ -233,7 +223,6 @@ public function render() { return null; } - /** * Set response status * @param int $status a HTTP status code, see also the STATUS constants @@ -267,7 +256,6 @@ public function getContentSecurityPolicy() { return $this->contentSecurityPolicy; } - /** * Get response status * @since 6.0.0 @@ -276,7 +264,6 @@ public function getStatus() { return $this->status; } - /** * Get the ETag * @return string the etag @@ -286,7 +273,6 @@ public function getETag() { return $this->ETag; } - /** * Get "last modified" date * @return \DateTime RFC2822 formatted last modified date @@ -296,7 +282,6 @@ public function getLastModified() { return $this->lastModified; } - /** * Set the ETag * @param string $ETag @@ -309,7 +294,6 @@ public function setETag($ETag) { return $this; } - /** * Set "last modified" date * @param \DateTime $lastModified @@ -322,5 +306,4 @@ public function setLastModified($lastModified) { return $this; } - } diff --git a/lib/public/AppFramework/Http/StreamResponse.php b/lib/public/AppFramework/Http/StreamResponse.php index d88404a5dfbd..f378a99eca0a 100644 --- a/lib/public/AppFramework/Http/StreamResponse.php +++ b/lib/public/AppFramework/Http/StreamResponse.php @@ -43,7 +43,6 @@ public function __construct ($filePath) { $this->filePath = $filePath; } - /** * Streams the file using readfile * diff --git a/lib/public/AppFramework/Http/TemplateResponse.php b/lib/public/AppFramework/Http/TemplateResponse.php index 6db3385a7df5..b7fdd33e88fe 100644 --- a/lib/public/AppFramework/Http/TemplateResponse.php +++ b/lib/public/AppFramework/Http/TemplateResponse.php @@ -29,7 +29,6 @@ namespace OCP\AppFramework\Http; - /** * Response for a normal template * @since 6.0.0 @@ -77,7 +76,6 @@ public function __construct($appName, $templateName, array $params= [], $this->renderAs = $renderAs; } - /** * Sets template parameters * @param array $params an array with key => value structure which sets template @@ -91,7 +89,6 @@ public function setParams(array $params){ return $this; } - /** * Used for accessing the set parameters * @return array the params @@ -101,7 +98,6 @@ public function getParams(){ return $this->params; } - /** * Used for accessing the name of the set template * @return string the name of the used template @@ -111,7 +107,6 @@ public function getTemplateName(){ return $this->templateName; } - /** * Sets the template page * @param string $renderAs admin, user or blank. Admin also prints the admin @@ -127,7 +122,6 @@ public function renderAs($renderAs){ return $this; } - /** * Returns the set renderAs * @return string the renderAs value @@ -137,7 +131,6 @@ public function getRenderAs(){ return $this->renderAs; } - /** * Returns the rendered html * @return string the rendered html diff --git a/lib/public/AppFramework/IApi.php b/lib/public/AppFramework/IApi.php index 342364ba212a..961aac3a8946 100644 --- a/lib/public/AppFramework/IApi.php +++ b/lib/public/AppFramework/IApi.php @@ -29,14 +29,12 @@ namespace OCP\AppFramework; - /** * A few very basic and frequently used API functions are combined in here * @deprecated 8.0.0 */ interface IApi { - /** * Gets the userid of the current user * @return string the user id of the current user @@ -44,7 +42,6 @@ interface IApi { */ function getUserId(); - /** * Adds a new javascript file * @deprecated 8.0.0 include javascript and css in template files @@ -54,7 +51,6 @@ function getUserId(); */ function addScript($scriptName, $appName = null); - /** * Adds a new css file * @deprecated 8.0.0 include javascript and css in template files @@ -64,7 +60,6 @@ function addScript($scriptName, $appName = null); */ function addStyle($styleName, $appName = null); - /** * @deprecated 8.0.0 include javascript and css in template files * shorthand for addScript for files in the 3rdparty directory @@ -73,7 +68,6 @@ function addStyle($styleName, $appName = null); */ function add3rdPartyScript($name); - /** * @deprecated 8.0.0 include javascript and css in template files * shorthand for addStyle for files in the 3rdparty directory @@ -82,7 +76,6 @@ function add3rdPartyScript($name); */ function add3rdPartyStyle($name); - /** * Checks if an app is enabled * @deprecated 8.0.0 communication between apps should happen over built in diff --git a/lib/public/AppFramework/Middleware.php b/lib/public/AppFramework/Middleware.php index b8e38de4ea02..5969f0e057ca 100644 --- a/lib/public/AppFramework/Middleware.php +++ b/lib/public/AppFramework/Middleware.php @@ -31,7 +31,6 @@ use OCP\AppFramework\Http\Response; - /** * Middleware is used to provide hooks before or after controller methods and * deal with possible exceptions raised in the controller methods. @@ -41,7 +40,6 @@ */ abstract class Middleware { - /** * This is being run in normal order before the controller is being * called which allows several modifications and checks @@ -55,7 +53,6 @@ public function beforeController($controller, $methodName){ } - /** * This is being run when either the beforeController method or the * controller method itself is throwing an exception. The middleware is @@ -75,7 +72,6 @@ public function afterException($controller, $methodName, \Exception $exception){ throw $exception; } - /** * This is being run after a successful controllermethod call and allows * the manipulation of a Response object. The middleware is run in reverse order @@ -91,7 +87,6 @@ public function afterController($controller, $methodName, Response $response){ return $response; } - /** * This is being run after the response object has been rendered and * allows the manipulation of the output. The middleware is run in reverse order diff --git a/lib/public/AppFramework/OCSController.php b/lib/public/AppFramework/OCSController.php index f1c6aaf67d64..9ef4b2dbbbac 100644 --- a/lib/public/AppFramework/OCSController.php +++ b/lib/public/AppFramework/OCSController.php @@ -38,7 +38,6 @@ use OCP\AppFramework\Http\Response; use OCP\IRequest; - /** * Base class to inherit your controllers from that are used for RESTful APIs * @since 8.1.0 @@ -74,7 +73,6 @@ public function __construct($appName, }); } - /** * Unwrap data and build ocs response * @param string $format json or xml diff --git a/lib/public/AppFramework/Utility/ITimeFactory.php b/lib/public/AppFramework/Utility/ITimeFactory.php index 5d03a987819b..3b8053b3626d 100644 --- a/lib/public/AppFramework/Utility/ITimeFactory.php +++ b/lib/public/AppFramework/Utility/ITimeFactory.php @@ -20,10 +20,8 @@ * */ - namespace OCP\AppFramework\Utility; - /** * Needed to mock calls to time() * @since 8.0.0 diff --git a/lib/public/BackgroundJob.php b/lib/public/BackgroundJob.php index 62089638eeeb..6d2403f0647d 100644 --- a/lib/public/BackgroundJob.php +++ b/lib/public/BackgroundJob.php @@ -35,7 +35,6 @@ // This means that they should be used by apps instead of the internal ownCloud classes namespace OCP; - /** * This class provides functions to register backgroundjobs in ownCloud * diff --git a/lib/public/Comments/IComment.php b/lib/public/Comments/IComment.php index 1f9503e7a19f..bcfd2964a7b8 100644 --- a/lib/public/Comments/IComment.php +++ b/lib/public/Comments/IComment.php @@ -83,7 +83,6 @@ public function setParentId($parentId); */ public function getTopmostParentId(); - /** * sets the topmost parent ID and returns itself * diff --git a/lib/public/DB/QueryBuilder/IExpressionBuilder.php b/lib/public/DB/QueryBuilder/IExpressionBuilder.php index 5f8edf5b5b2d..cb76335c38ac 100644 --- a/lib/public/DB/QueryBuilder/IExpressionBuilder.php +++ b/lib/public/DB/QueryBuilder/IExpressionBuilder.php @@ -23,7 +23,6 @@ namespace OCP\DB\QueryBuilder; - use Doctrine\DBAL\Query\Expression\ExpressionBuilder; /** diff --git a/lib/public/DB/QueryBuilder/IQueryBuilder.php b/lib/public/DB/QueryBuilder/IQueryBuilder.php index 55c2089e0a33..b9953acfcc2c 100644 --- a/lib/public/DB/QueryBuilder/IQueryBuilder.php +++ b/lib/public/DB/QueryBuilder/IQueryBuilder.php @@ -22,7 +22,6 @@ namespace OCP\DB\QueryBuilder; - use Doctrine\DBAL\Connection; /** @@ -65,7 +64,6 @@ interface IQueryBuilder { */ const PARAM_STR_ARRAY = Connection::PARAM_STR_ARRAY; - /** * Enable/disable automatic prefixing of table names with the oc_ prefix * diff --git a/lib/public/Encryption/IManager.php b/lib/public/Encryption/IManager.php index b88558964bf6..b35f8fbd4d97 100644 --- a/lib/public/Encryption/IManager.php +++ b/lib/public/Encryption/IManager.php @@ -68,7 +68,6 @@ public function unregisterEncryptionModule($moduleId); */ public function getEncryptionModules(); - /** * get a specific encryption module * diff --git a/lib/public/Files/External/Backend/InvalidBackend.php b/lib/public/Files/External/Backend/InvalidBackend.php index 472b94d600f0..033a9d086322 100644 --- a/lib/public/Files/External/Backend/InvalidBackend.php +++ b/lib/public/Files/External/Backend/InvalidBackend.php @@ -21,7 +21,6 @@ namespace OCP\Files\External\Backend; - /** * Invalid storage backend representing a backend * that could not be resolved diff --git a/lib/public/Files/External/IStoragesBackendService.php b/lib/public/Files/External/IStoragesBackendService.php index e4acf42288be..8e86685e7203 100644 --- a/lib/public/Files/External/IStoragesBackendService.php +++ b/lib/public/Files/External/IStoragesBackendService.php @@ -21,7 +21,6 @@ namespace OCP\Files\External; - use \OCP\Files\External\Backend\Backend; use \OCP\Files\External\Auth\AuthMechanism; use \OCP\Files\External\Config\IBackendProvider; diff --git a/lib/public/Files/IMimeTypeDetector.php b/lib/public/Files/IMimeTypeDetector.php index 6e1c62815ace..ee1b6f0d0645 100644 --- a/lib/public/Files/IMimeTypeDetector.php +++ b/lib/public/Files/IMimeTypeDetector.php @@ -23,7 +23,6 @@ // This means that they should be used by apps instead of the internal ownCloud classes namespace OCP\Files; - /** * Interface IMimeTypeDetector * @package OCP\Files diff --git a/lib/public/Files/IProvidesAdditionalHeaders.php b/lib/public/Files/IProvidesAdditionalHeaders.php index 6a0a8caf17dc..e1b935ac3b25 100644 --- a/lib/public/Files/IProvidesAdditionalHeaders.php +++ b/lib/public/Files/IProvidesAdditionalHeaders.php @@ -19,10 +19,8 @@ * */ - namespace OCP\Files; - /** * Interface IProvidesAdditionalHeaders * This interface allows to add additional headers to the response diff --git a/lib/public/Files/IRootFolder.php b/lib/public/Files/IRootFolder.php index 7f58d75485be..d6c11d4f6853 100644 --- a/lib/public/Files/IRootFolder.php +++ b/lib/public/Files/IRootFolder.php @@ -20,7 +20,6 @@ * */ - namespace OCP\Files; use OC\Hooks\Emitter; diff --git a/lib/public/Files/Node.php b/lib/public/Files/Node.php index d4707bc1b424..c391095be404 100644 --- a/lib/public/Files/Node.php +++ b/lib/public/Files/Node.php @@ -154,7 +154,6 @@ public function getSize(); */ public function getEtag(); - /** * Get the permissions of the file or folder as a combination of one or more of the following constants: * - \OCP\Constants::PERMISSION_READ diff --git a/lib/public/Files/ObjectStore/IVersionedObjectStorage.php b/lib/public/Files/ObjectStore/IVersionedObjectStorage.php index db311a855be9..a6c0401a3c2b 100644 --- a/lib/public/Files/ObjectStore/IVersionedObjectStorage.php +++ b/lib/public/Files/ObjectStore/IVersionedObjectStorage.php @@ -19,7 +19,6 @@ * */ - namespace OCP\Files\ObjectStore; /** diff --git a/lib/public/Files/Storage/IVersionedStorage.php b/lib/public/Files/Storage/IVersionedStorage.php index 6c038b9f9cd4..bacd4c24d414 100644 --- a/lib/public/Files/Storage/IVersionedStorage.php +++ b/lib/public/Files/Storage/IVersionedStorage.php @@ -19,7 +19,6 @@ * */ - namespace OCP\Files\Storage; /** diff --git a/lib/public/Http/HttpEvents.php b/lib/public/Http/HttpEvents.php index 11a69688f649..453d9b2a0f2d 100644 --- a/lib/public/Http/HttpEvents.php +++ b/lib/public/Http/HttpEvents.php @@ -54,7 +54,6 @@ public function getEvent() { return $this->event; } - /** * @return IRequest * @since 10.0.3 diff --git a/lib/public/IConfig.php b/lib/public/IConfig.php index 0e2e16d6b717..9284e6be0954 100644 --- a/lib/public/IConfig.php +++ b/lib/public/IConfig.php @@ -139,7 +139,6 @@ public function deleteAppValue($appName, $key); */ public function deleteAppValues($appName); - /** * Set a user defined value * diff --git a/lib/public/IContainer.php b/lib/public/IContainer.php index 6f45278ecf71..e319cc1ddb98 100644 --- a/lib/public/IContainer.php +++ b/lib/public/IContainer.php @@ -35,7 +35,6 @@ use Closure; use OCP\AppFramework\QueryException; - /** * Class IContainer * diff --git a/lib/public/IDb.php b/lib/public/IDb.php index acda8f0e7547..109daf840c47 100644 --- a/lib/public/IDb.php +++ b/lib/public/IDb.php @@ -22,14 +22,12 @@ namespace OCP; - /** * Small Facade for being able to inject the database connection for tests * @since 7.0.0 - extends IDBConnection was added in 8.1.0 */ interface IDb extends IDBConnection { - /** * Used to abstract the owncloud database access away * @param string $sql the sql query with ? placeholder for params @@ -40,7 +38,6 @@ interface IDb extends IDBConnection { */ public function prepareQuery($sql, $limit=null, $offset=null); - /** * Used to get the id of the just inserted element * @param string $tableName the name of the table where we inserted the item @@ -49,5 +46,4 @@ public function prepareQuery($sql, $limit=null, $offset=null); */ public function getInsertId($tableName); - } diff --git a/lib/public/IL10N.php b/lib/public/IL10N.php index 5c5ea8dbab6a..6e697a9ec1e9 100644 --- a/lib/public/IL10N.php +++ b/lib/public/IL10N.php @@ -101,7 +101,6 @@ public function n($text_singular, $text_plural, $count, $parameters = []); */ public function l($type, $data, $options = []); - /** * The code (en, de, ...) of the language that is used for this IL10N object * diff --git a/lib/public/IPreview.php b/lib/public/IPreview.php index c628632c007c..2fac6ff8f9bf 100644 --- a/lib/public/IPreview.php +++ b/lib/public/IPreview.php @@ -75,7 +75,6 @@ public function hasProviders(); */ public function createPreview($file, $maxX = 100, $maxY = 75, $scaleUp = false); - /** * Returns true if the passed mime type is supported * @param string $mimeType diff --git a/lib/public/IRequest.php b/lib/public/IRequest.php index 08d50e8a3b74..4d7e3197f8e2 100644 --- a/lib/public/IRequest.php +++ b/lib/public/IRequest.php @@ -86,7 +86,6 @@ public function getHeader($name); */ public function getParam($key, $default = null); - /** * Returns all params that were received, be it from the request * @@ -114,7 +113,6 @@ public function getMethod(); */ public function getUploadedFile($key); - /** * Shortcut for getting env variables * @@ -124,7 +122,6 @@ public function getUploadedFile($key); */ public function getEnv($key); - /** * Shortcut for getting cookie variables * @@ -134,7 +131,6 @@ public function getEnv($key); */ public function getCookie($key); - /** * Checks if the CSRF check was correct * diff --git a/lib/public/ISearch.php b/lib/public/ISearch.php index 6d8184777e45..7051eff3ae20 100644 --- a/lib/public/ISearch.php +++ b/lib/public/ISearch.php @@ -26,7 +26,6 @@ namespace OCP; - /** * Small Interface for Search * @since 7.0.0 diff --git a/lib/public/IServerContainer.php b/lib/public/IServerContainer.php index 9f02949e4b2a..7c9c0afddc57 100644 --- a/lib/public/IServerContainer.php +++ b/lib/public/IServerContainer.php @@ -45,7 +45,6 @@ use OCP\Security\IContentSecurityPolicyManager; use Symfony\Component\EventDispatcher\EventDispatcherInterface; - /** * Class IServerContainer * @package OCP diff --git a/lib/public/ISession.php b/lib/public/ISession.php index d95ac39ea11d..133d93b066ce 100644 --- a/lib/public/ISession.php +++ b/lib/public/ISession.php @@ -29,7 +29,6 @@ * */ - // use OCP namespace for all classes that are considered public. // This means that they should be used by apps instead of the internal ownCloud classes namespace OCP; diff --git a/lib/public/ISubAdminManager.php b/lib/public/ISubAdminManager.php index 306f893b3a4f..db0598e481da 100644 --- a/lib/public/ISubAdminManager.php +++ b/lib/public/ISubAdminManager.php @@ -21,7 +21,6 @@ namespace OCP; - /** * Sub admin manager * diff --git a/lib/public/IURLGenerator.php b/lib/public/IURLGenerator.php index c907345fcfcd..c81fff68ec18 100644 --- a/lib/public/IURLGenerator.php +++ b/lib/public/IURLGenerator.php @@ -75,7 +75,6 @@ public function linkTo($appName, $file, $args = []); */ public function imagePath($appName, $file); - /** * Makes an URL absolute * @param string $url the url in the ownCloud host diff --git a/lib/public/IUserManager.php b/lib/public/IUserManager.php index 9bb98398ab3a..f94d29420243 100644 --- a/lib/public/IUserManager.php +++ b/lib/public/IUserManager.php @@ -26,7 +26,6 @@ namespace OCP; - /** * Class Manager * diff --git a/lib/public/L10N/IFactory.php b/lib/public/L10N/IFactory.php index 0196cabd8e20..702cb4b38855 100644 --- a/lib/public/L10N/IFactory.php +++ b/lib/public/L10N/IFactory.php @@ -67,7 +67,6 @@ public function languageExists($app, $lang); */ public function setLanguageFromRequest($app = null); - /** * Creates a function from the plural string * diff --git a/lib/public/SabrePluginEvent.php b/lib/public/SabrePluginEvent.php index 4c2de189c46f..260654030621 100644 --- a/lib/public/SabrePluginEvent.php +++ b/lib/public/SabrePluginEvent.php @@ -22,7 +22,6 @@ namespace OCP; - use OCP\AppFramework\Http; use Sabre\DAV\Server; use Symfony\Component\EventDispatcher\Event; diff --git a/lib/public/SabrePluginException.php b/lib/public/SabrePluginException.php index 1e7e21fe7140..8491a5a04b43 100644 --- a/lib/public/SabrePluginException.php +++ b/lib/public/SabrePluginException.php @@ -21,7 +21,6 @@ namespace OCP; - use Sabre\DAV\Exception; /** diff --git a/lib/public/Security/StringUtils.php b/lib/public/Security/StringUtils.php index 497f73a98fe7..677731cf40b6 100644 --- a/lib/public/Security/StringUtils.php +++ b/lib/public/Security/StringUtils.php @@ -20,7 +20,6 @@ * */ - namespace OCP\Security; /** diff --git a/lib/public/Share.php b/lib/public/Share.php index fdcc14cfee53..4cc91fa5f9f6 100644 --- a/lib/public/Share.php +++ b/lib/public/Share.php @@ -201,7 +201,6 @@ public static function resolveReShare($linkItem) { return \OC\Share\Share::resolveReShare($linkItem); } - /** * Get the shared items of item type owned by the current user * @param string $itemType @@ -360,7 +359,6 @@ public static function setPassword($shareId, $password) { return \OC\Share\Share::setPassword($userSession, $connection, $config, $shareId, $password); } - /** * Get the backend class for the specified item type * @param string $itemType diff --git a/lib/public/Share/Events/ShareEvent.php b/lib/public/Share/Events/ShareEvent.php index d50968738b98..0033c25aa73d 100644 --- a/lib/public/Share/Events/ShareEvent.php +++ b/lib/public/Share/Events/ShareEvent.php @@ -21,7 +21,6 @@ namespace OCP\Share\Events; - use Symfony\Component\EventDispatcher\Event; /** diff --git a/lib/public/Share/IManager.php b/lib/public/Share/IManager.php index 2e71f80a3f98..010244ce9968 100644 --- a/lib/public/Share/IManager.php +++ b/lib/public/Share/IManager.php @@ -112,7 +112,6 @@ public function getAllSharesBy($userId, $shareTypes, $nodeIDs, $reshares = false */ public function getSharesBy($userId, $shareType, $path = null, $reshares = false, $limit = 50, $offset = 0); - /** * Get shares shared with $userId for specified share types. * Filter by $node if provided diff --git a/lib/public/Share/IShareProvider.php b/lib/public/Share/IShareProvider.php index e9fd98a9d1fe..fbe58c061373 100644 --- a/lib/public/Share/IShareProvider.php +++ b/lib/public/Share/IShareProvider.php @@ -137,7 +137,6 @@ public function getShareById($id, $recipientId = null); */ public function getSharesByPath(Node $path); - /** * Get shared with the given user for shares of all supported share types for this share provider, * with file_source predicate specified ($node is Node) or diff --git a/lib/public/Template.php b/lib/public/Template.php index ada9333d38d6..f6a69e19e4c8 100644 --- a/lib/public/Template.php +++ b/lib/public/Template.php @@ -38,7 +38,6 @@ // This means that they should be used by apps instead of the internal ownCloud classes namespace OCP; - /** * Make OC_Helper::imagePath available as a simple function * @param string $app @@ -52,7 +51,6 @@ function image_path($app, $image) { return(\image_path($app, $image)); } - /** * Make OC_Helper::mimetypeIcon available as a simple function * @param string $mimetype @@ -96,7 +94,6 @@ function human_file_size($bytes) { return(\human_file_size($bytes)); } - /** * Return the relative date in relation to today. Returns something like "last hour" or "two month ago" * @param int $timestamp unix timestamp @@ -109,7 +106,6 @@ function relative_modified_date($timestamp, $dateOnly = false) { return(\relative_modified_date($timestamp, null, $dateOnly)); } - /** * Return a human readable outout for a file size. * @param integer $bytes size of a file in byte @@ -120,7 +116,6 @@ function simple_file_size($bytes) { return(\human_file_size($bytes)); } - /** * Generate html code for an options block. * @param array $options the options @@ -133,7 +128,6 @@ function html_select_options($options, $selected, $params= []) { return(\html_select_options($options, $selected, $params)); } - /** * This class provides the template system for owncloud. You can use it to load * specific templates, add data and generate the html code @@ -155,7 +149,6 @@ public static function image_path($app, $image) { return \image_path($app, $image); } - /** * Make OC_Helper::mimetypeIcon available as a simple function * diff --git a/lib/public/User/IChangePasswordBackend.php b/lib/public/User/IChangePasswordBackend.php index 6128bdd941db..5cbe789ef11d 100644 --- a/lib/public/User/IChangePasswordBackend.php +++ b/lib/public/User/IChangePasswordBackend.php @@ -19,7 +19,6 @@ * */ - // use OCP namespace for all classes that are considered public. // This means that they should be used by apps instead of the internal ownCloud classes namespace OCP\User; diff --git a/lib/public/User/IProvidesDisplayNameBackend.php b/lib/public/User/IProvidesDisplayNameBackend.php index 583717db96cd..0fcb82c7bcc3 100644 --- a/lib/public/User/IProvidesDisplayNameBackend.php +++ b/lib/public/User/IProvidesDisplayNameBackend.php @@ -19,7 +19,6 @@ * */ - // use OCP namespace for all classes that are considered public. // This means that they should be used by apps instead of the internal ownCloud classes namespace OCP\User; diff --git a/lib/public/User/IProvidesEMailBackend.php b/lib/public/User/IProvidesEMailBackend.php index 74bcad16f6e3..3bf44e6a9d6a 100644 --- a/lib/public/User/IProvidesEMailBackend.php +++ b/lib/public/User/IProvidesEMailBackend.php @@ -19,7 +19,6 @@ * */ - // use OCP namespace for all classes that are considered public. // This means that they should be used by apps instead of the internal ownCloud classes namespace OCP\User; diff --git a/lib/public/User/IProvidesExtendedSearchBackend.php b/lib/public/User/IProvidesExtendedSearchBackend.php index 177bbce3ee1a..ec9305cc687d 100644 --- a/lib/public/User/IProvidesExtendedSearchBackend.php +++ b/lib/public/User/IProvidesExtendedSearchBackend.php @@ -19,7 +19,6 @@ * */ - // use OCP namespace for all classes that are considered public. // This means that they should be used by apps instead of the internal ownCloud classes namespace OCP\User; diff --git a/lib/public/User/IProvidesHomeBackend.php b/lib/public/User/IProvidesHomeBackend.php index 055e414fb216..2c0a6c63acfc 100644 --- a/lib/public/User/IProvidesHomeBackend.php +++ b/lib/public/User/IProvidesHomeBackend.php @@ -19,7 +19,6 @@ * */ - // use OCP namespace for all classes that are considered public. // This means that they should be used by apps instead of the internal ownCloud classes namespace OCP\User; diff --git a/lib/public/User/IProvidesQuotaBackend.php b/lib/public/User/IProvidesQuotaBackend.php index 81e54d5de5da..1a368d767875 100644 --- a/lib/public/User/IProvidesQuotaBackend.php +++ b/lib/public/User/IProvidesQuotaBackend.php @@ -19,7 +19,6 @@ * */ - // use OCP namespace for all classes that are considered public. // This means that they should be used by apps instead of the internal ownCloud classes namespace OCP\User; diff --git a/lib/public/Util/UserSearch.php b/lib/public/Util/UserSearch.php index 89b41844b4ee..d971d2d0fa88 100644 --- a/lib/public/Util/UserSearch.php +++ b/lib/public/Util/UserSearch.php @@ -25,7 +25,6 @@ * */ - namespace OCP\Util; use OCP\IConfig; diff --git a/ocs/routes.php b/ocs/routes.php index 5fddf3ef82bf..cf8aa792ea0b 100644 --- a/ocs/routes.php +++ b/ocs/routes.php @@ -126,7 +126,6 @@ API::GUEST_AUTH ); - API::register('post', '/cloud/shares/{id}/accept', [$s2s, 'acceptShare'], diff --git a/settings/Controller/AuthSettingsController.php b/settings/Controller/AuthSettingsController.php index 82d0c32c4e0d..3b01c895814e 100644 --- a/settings/Controller/AuthSettingsController.php +++ b/settings/Controller/AuthSettingsController.php @@ -178,7 +178,6 @@ public function destroy($id) { return (new JSONResponse())->setStatus(Http::STATUS_CONFLICT); } - if (\is_null($user)) { return []; } diff --git a/settings/Controller/CheckSetupController.php b/settings/Controller/CheckSetupController.php index 6f302d58d429..1a206c294ed0 100644 --- a/settings/Controller/CheckSetupController.php +++ b/settings/Controller/CheckSetupController.php @@ -298,7 +298,6 @@ public function getFailedIntegrityCheckFiles() { $formattedTextResponse = 'No errors have been found.'; } - $response = new DataDisplayResponse( $formattedTextResponse, Http::STATUS_OK, diff --git a/settings/Panels/Personal/Cors.php b/settings/Panels/Personal/Cors.php index 4610940c406e..ba0ef15f3dd1 100644 --- a/settings/Panels/Personal/Cors.php +++ b/settings/Panels/Personal/Cors.php @@ -67,7 +67,6 @@ public function getPanel() { return $t; } - public function getPriority() { return 20; } diff --git a/settings/ajax/setlanguage.php b/settings/ajax/setlanguage.php index b88ab3344f44..97480c204328 100644 --- a/settings/ajax/setlanguage.php +++ b/settings/ajax/setlanguage.php @@ -29,7 +29,6 @@ OC_JSON::checkLoggedIn(); OCP\JSON::callCheck(); - // Get data if(isset($_POST['lang'])) { $languageCodes = \OC::$server->getL10NFactory()->findAvailableLanguages(); diff --git a/settings/help.php b/settings/help.php index 3e521b1aeece..04978ad67408 100644 --- a/settings/help.php +++ b/settings/help.php @@ -33,7 +33,6 @@ OC_Util::addStyle("settings", "settings"); \OC::$server->getNavigationManager()->setActiveEntry('help'); - if(isset($_GET['mode']) and $_GET['mode'] === 'admin') { $url=\OCP\Util::linkToAbsolute('core', 'doc/admin/index.html'); $style1=''; diff --git a/tests/Core/Command/Apps/AppsDisableTest.php b/tests/Core/Command/Apps/AppsDisableTest.php index d332ee8e9694..16bcebe0747a 100644 --- a/tests/Core/Command/Apps/AppsDisableTest.php +++ b/tests/Core/Command/Apps/AppsDisableTest.php @@ -19,10 +19,8 @@ * */ - namespace Tests\Core\Command\Config; - use OC\Core\Command\App\Disable; use Symfony\Component\Console\Tester\CommandTester; use Test\TestCase; diff --git a/tests/Core/Command/Apps/AppsEnableTest.php b/tests/Core/Command/Apps/AppsEnableTest.php index c5693f6bc97d..ccd56737d247 100644 --- a/tests/Core/Command/Apps/AppsEnableTest.php +++ b/tests/Core/Command/Apps/AppsEnableTest.php @@ -19,10 +19,8 @@ * */ - namespace Tests\Core\Command\Config; - use OC\Core\Command\App\Enable; use Symfony\Component\Console\Tester\CommandTester; use Test\TestCase; diff --git a/tests/Core/Command/Apps/AppsGetPathTest.php b/tests/Core/Command/Apps/AppsGetPathTest.php index 5a47de1d7080..fe2020afe412 100644 --- a/tests/Core/Command/Apps/AppsGetPathTest.php +++ b/tests/Core/Command/Apps/AppsGetPathTest.php @@ -19,7 +19,6 @@ * */ - namespace Tests\Core\Command\Config; use OC\Core\Command\App\GetPath; diff --git a/tests/Core/Command/Apps/AppsListTest.php b/tests/Core/Command/Apps/AppsListTest.php index 7e4e4d9a8f30..cd830277f3fa 100644 --- a/tests/Core/Command/Apps/AppsListTest.php +++ b/tests/Core/Command/Apps/AppsListTest.php @@ -19,7 +19,6 @@ * */ - namespace Tests\Core\Command\Config; use OC\Core\Command\App\ListApps; diff --git a/tests/Core/Command/Apps/CheckCodeTest.php b/tests/Core/Command/Apps/CheckCodeTest.php index d86bbbe33e0a..310ecafec7d6 100644 --- a/tests/Core/Command/Apps/CheckCodeTest.php +++ b/tests/Core/Command/Apps/CheckCodeTest.php @@ -19,7 +19,6 @@ * */ - namespace Tests\Core\Command\Config; use OCP\App\IAppManager; diff --git a/tests/Core/Command/Config/App/DeleteConfigTest.php b/tests/Core/Command/Config/App/DeleteConfigTest.php index 4bf670cd1b23..944d4ddd5078 100644 --- a/tests/Core/Command/Config/App/DeleteConfigTest.php +++ b/tests/Core/Command/Config/App/DeleteConfigTest.php @@ -21,7 +21,6 @@ namespace Tests\Core\Command\Config\App; - use OC\Core\Command\Config\App\DeleteConfig; use Test\TestCase; @@ -50,7 +49,6 @@ protected function setUp() { $this->command = new DeleteConfig($config); } - public function deleteData() { return [ [ diff --git a/tests/Core/Command/Config/App/GetConfigTest.php b/tests/Core/Command/Config/App/GetConfigTest.php index b3c4a63e9aaa..0b9a053444a2 100644 --- a/tests/Core/Command/Config/App/GetConfigTest.php +++ b/tests/Core/Command/Config/App/GetConfigTest.php @@ -21,7 +21,6 @@ namespace Tests\Core\Command\Config\App; - use OC\Core\Command\Config\App\GetConfig; use OCP\IConfig; use Symfony\Component\Console\Input\InputInterface; @@ -52,7 +51,6 @@ protected function setUp() { $this->command = new GetConfig($config); } - public function getData() { return [ // String output as json diff --git a/tests/Core/Command/Config/App/SetConfigTest.php b/tests/Core/Command/Config/App/SetConfigTest.php index 17bddf91d726..9f2957cd15a0 100644 --- a/tests/Core/Command/Config/App/SetConfigTest.php +++ b/tests/Core/Command/Config/App/SetConfigTest.php @@ -21,7 +21,6 @@ namespace Tests\Core\Command\Config\App; - use OC\Core\Command\Config\App\SetConfig; use Test\TestCase; @@ -50,7 +49,6 @@ protected function setUp() { $this->command = new SetConfig($config); } - public function setData() { return [ [ diff --git a/tests/Core/Command/Config/ImportTest.php b/tests/Core/Command/Config/ImportTest.php index f0d061fa28f7..d91edc2a29fa 100644 --- a/tests/Core/Command/Config/ImportTest.php +++ b/tests/Core/Command/Config/ImportTest.php @@ -21,7 +21,6 @@ namespace Tests\Core\Command\Config; - use OC\Core\Command\Config\Import; use Test\TestCase; diff --git a/tests/Core/Command/Config/ListConfigsTest.php b/tests/Core/Command/Config/ListConfigsTest.php index 3401ac720554..ff22d6331610 100644 --- a/tests/Core/Command/Config/ListConfigsTest.php +++ b/tests/Core/Command/Config/ListConfigsTest.php @@ -21,7 +21,6 @@ namespace Tests\Core\Command\Config; - use OC\Core\Command\Config\ListConfigs; use OCP\IConfig; use Test\TestCase; diff --git a/tests/Core/Command/Config/System/DeleteConfigTest.php b/tests/Core/Command/Config/System/DeleteConfigTest.php index 2502c73d5c18..3ba32b2f9cb7 100644 --- a/tests/Core/Command/Config/System/DeleteConfigTest.php +++ b/tests/Core/Command/Config/System/DeleteConfigTest.php @@ -21,7 +21,6 @@ namespace Tests\Core\Command\Config\System; - use OC\Core\Command\Config\System\DeleteConfig; use Test\TestCase; diff --git a/tests/Core/Command/Config/System/GetConfigTest.php b/tests/Core/Command/Config/System/GetConfigTest.php index 1683a0580316..97ce3fcca0cc 100644 --- a/tests/Core/Command/Config/System/GetConfigTest.php +++ b/tests/Core/Command/Config/System/GetConfigTest.php @@ -21,7 +21,6 @@ namespace Tests\Core\Command\Config\System; - use OC\Core\Command\Config\System\GetConfig; use OC\SystemConfig; use Symfony\Component\Console\Input\InputInterface; @@ -51,7 +50,6 @@ protected function setUp() { $this->command = new GetConfig($systemConfig); } - public function getData() { return [ // String output as json diff --git a/tests/Core/Command/Config/System/SetConfigTest.php b/tests/Core/Command/Config/System/SetConfigTest.php index 5fe71d2ab733..e54f1dd08eba 100644 --- a/tests/Core/Command/Config/System/SetConfigTest.php +++ b/tests/Core/Command/Config/System/SetConfigTest.php @@ -21,7 +21,6 @@ namespace Tests\Core\Command\Config\System; - use OC\Core\Command\Config\System\SetConfig; use Test\TestCase; @@ -50,7 +49,6 @@ protected function setUp() { $this->command = new SetConfig($systemConfig); } - public function setData() { return [ [['name'], 'newvalue', null, 'newvalue'], diff --git a/tests/Core/Command/Encryption/ChangeKeyStorageRootTest.php b/tests/Core/Command/Encryption/ChangeKeyStorageRootTest.php index c7278cd9fbc5..6d0843a1ccac 100644 --- a/tests/Core/Command/Encryption/ChangeKeyStorageRootTest.php +++ b/tests/Core/Command/Encryption/ChangeKeyStorageRootTest.php @@ -19,10 +19,8 @@ * */ - namespace Tests\Core\Command\Encryption; - use OC\Core\Command\Encryption\ChangeKeyStorageRoot; use OC\Encryption\Util; use OC\Files\View; @@ -263,7 +261,6 @@ public function dataTestMoveSystemKeys() { ]; } - public function testMoveUserKeys() { $changeKeyStorageRoot = $this->getMockBuilder('OC\Core\Command\Encryption\ChangeKeyStorageRoot') @@ -341,7 +338,6 @@ public function dataTestMoveUserEncryptionFolder() { ]; } - /** * @dataProvider dataTestPrepareParentFolder */ diff --git a/tests/Core/Command/Encryption/DecryptAllTest.php b/tests/Core/Command/Encryption/DecryptAllTest.php index 0c5bee71bc7f..efc51eab0010 100644 --- a/tests/Core/Command/Encryption/DecryptAllTest.php +++ b/tests/Core/Command/Encryption/DecryptAllTest.php @@ -19,10 +19,8 @@ * */ - namespace Tests\Core\Command\Encryption; - use OC\Core\Command\Encryption\DecryptAll; use Test\TestCase; diff --git a/tests/Core/Command/Encryption/DisableTest.php b/tests/Core/Command/Encryption/DisableTest.php index f6232f318cc0..98e6262da7f2 100644 --- a/tests/Core/Command/Encryption/DisableTest.php +++ b/tests/Core/Command/Encryption/DisableTest.php @@ -21,7 +21,6 @@ namespace Tests\Core\Command\Encryption; - use OC\Core\Command\Encryption\Disable; use Test\TestCase; @@ -49,7 +48,6 @@ protected function setUp() { $this->command = new Disable($config); } - public function dataDisable() { return [ ['yes', true, 'Encryption disabled'], diff --git a/tests/Core/Command/Encryption/EnableTest.php b/tests/Core/Command/Encryption/EnableTest.php index 37d606c97c35..7b7b0e0cbb1c 100644 --- a/tests/Core/Command/Encryption/EnableTest.php +++ b/tests/Core/Command/Encryption/EnableTest.php @@ -21,7 +21,6 @@ namespace Tests\Core\Command\Encryption; - use OC\Core\Command\Encryption\Enable; use Test\TestCase; @@ -55,7 +54,6 @@ protected function setUp() { $this->command = new Enable($config, $manager); } - public function dataEnable() { return [ ['no', null, [], true, 'Encryption enabled', 'No encryption module is loaded'], diff --git a/tests/Core/Command/Encryption/EncryptAllTest.php b/tests/Core/Command/Encryption/EncryptAllTest.php index 1d8718e748f0..cd3b6d63d01d 100644 --- a/tests/Core/Command/Encryption/EncryptAllTest.php +++ b/tests/Core/Command/Encryption/EncryptAllTest.php @@ -19,10 +19,8 @@ * */ - namespace Tests\Core\Command\Encryption; - use OC\Core\Command\Encryption\EncryptAll; use Test\TestCase; diff --git a/tests/Core/Command/Encryption/SetDefaultModuleTest.php b/tests/Core/Command/Encryption/SetDefaultModuleTest.php index 231ebfcc2a77..30b0cad96997 100644 --- a/tests/Core/Command/Encryption/SetDefaultModuleTest.php +++ b/tests/Core/Command/Encryption/SetDefaultModuleTest.php @@ -21,7 +21,6 @@ namespace Tests\Core\Command\Encryption; - use OC\Core\Command\Encryption\SetDefaultModule; use Test\TestCase; @@ -49,7 +48,6 @@ protected function setUp() { $this->command = new SetDefaultModule($manager); } - public function dataSetDefaultModule() { return [ ['ID0', 'ID0', null, null, 'already'], diff --git a/tests/Core/Command/Group/DeleteTest.php b/tests/Core/Command/Group/DeleteTest.php index 041817f5542b..df03a7000050 100644 --- a/tests/Core/Command/Group/DeleteTest.php +++ b/tests/Core/Command/Group/DeleteTest.php @@ -48,7 +48,6 @@ protected function setUp() { $this->command = new Delete($groupManager); } - public function validGroupLastSeen() { return [ [true, 'The specified group was deleted'], diff --git a/tests/Core/Command/Log/ManageTest.php b/tests/Core/Command/Log/ManageTest.php index a9c6625c2468..2f2fe8e83169 100644 --- a/tests/Core/Command/Log/ManageTest.php +++ b/tests/Core/Command/Log/ManageTest.php @@ -21,7 +21,6 @@ namespace Tests\Core\Command\Log; - use OC\Core\Command\Log\Manage; use Test\TestCase; diff --git a/tests/Core/Command/Log/OwnCloudTest.php b/tests/Core/Command/Log/OwnCloudTest.php index 33877c4da8bf..e5f6b2ac3d22 100644 --- a/tests/Core/Command/Log/OwnCloudTest.php +++ b/tests/Core/Command/Log/OwnCloudTest.php @@ -21,7 +21,6 @@ namespace Tests\Core\Command\Log; - use OC\Core\Command\Log\OwnCloud; use Test\TestCase; diff --git a/tests/Core/Command/Maintenance/DataFingerprintTest.php b/tests/Core/Command/Maintenance/DataFingerprintTest.php index c4830105ca15..b8fb1ee5c51c 100644 --- a/tests/Core/Command/Maintenance/DataFingerprintTest.php +++ b/tests/Core/Command/Maintenance/DataFingerprintTest.php @@ -87,6 +87,5 @@ public function testSetFingerPrint($expectToLog, $answer) { $output = $this->commandTester->getDisplay(); $this->assertContains("Do you want to set the data fingerprint?", $output); - } } diff --git a/tests/Core/Command/Maintenance/SingleUserTest.php b/tests/Core/Command/Maintenance/SingleUserTest.php index 7dac76b7d1fa..34a8984a3956 100644 --- a/tests/Core/Command/Maintenance/SingleUserTest.php +++ b/tests/Core/Command/Maintenance/SingleUserTest.php @@ -21,7 +21,6 @@ namespace Tests\Core\Command\Maintenance; - use OC\Core\Command\Maintenance\SingleUser; use Test\TestCase; diff --git a/tests/Core/Command/User/DeleteTest.php b/tests/Core/Command/User/DeleteTest.php index d1237994ac48..d7113a68e95a 100644 --- a/tests/Core/Command/User/DeleteTest.php +++ b/tests/Core/Command/User/DeleteTest.php @@ -22,7 +22,6 @@ namespace Tests\Core\Command\User; - use OC\Core\Command\User\Delete; use OCP\IUserManager; use Symfony\Component\Console\Application; @@ -55,7 +54,6 @@ protected function setUp() { } - public function validUserLastSeen() { return [ [true, "User with uid 'user', display name 'Display Name', email 'email@host.tld' was deleted"], diff --git a/tests/Core/Command/User/LastSeenTest.php b/tests/Core/Command/User/LastSeenTest.php index 86e32918dc1e..90aa846d4482 100644 --- a/tests/Core/Command/User/LastSeenTest.php +++ b/tests/Core/Command/User/LastSeenTest.php @@ -21,7 +21,6 @@ namespace Tests\Core\Command\User; - use OC\Core\Command\User\LastSeen; use Test\TestCase; diff --git a/tests/Core/Command/User/ListUsersTest.php b/tests/Core/Command/User/ListUsersTest.php index 87de5116a962..4f59c389c3fe 100644 --- a/tests/Core/Command/User/ListUsersTest.php +++ b/tests/Core/Command/User/ListUsersTest.php @@ -48,7 +48,6 @@ protected function tearDown() { \OC::$server->getUserManager()->get('testlistuser')->delete(); } - /** * @dataProvider inputProvider * @param array $input diff --git a/tests/Core/Command/User/SettingTest.php b/tests/Core/Command/User/SettingTest.php index 966c912fa965..e4233fc9e7c9 100644 --- a/tests/Core/Command/User/SettingTest.php +++ b/tests/Core/Command/User/SettingTest.php @@ -21,7 +21,6 @@ namespace Tests\Core\Command\User; - use OC\Core\Command\User\Setting; use Test\TestCase; @@ -459,7 +458,6 @@ public function testExecuteList() { ->method('writeArrayInOutputFormat') ->with($this->consoleInput, $this->consoleOutput, ['settings']); - $this->assertEquals(0, $this->invokePrivate($command, 'execute', [$this->consoleInput, $this->consoleOutput])); } } diff --git a/tests/Core/Controller/AvatarControllerTest.php b/tests/Core/Controller/AvatarControllerTest.php index 5b44f2841eec..f70d7bd05b7f 100644 --- a/tests/Core/Controller/AvatarControllerTest.php +++ b/tests/Core/Controller/AvatarControllerTest.php @@ -262,7 +262,6 @@ public function testTmpAvatarValid() { $this->assertEquals(Http::STATUS_OK, $response->getStatus()); } - /** * When trying to post a new avatar a path or image should be posted. */ @@ -395,7 +394,6 @@ public function testPostAvatarException() { $this->assertEquals($expectedResponse, $this->avatarController->postAvatar('avatar.jpg')); } - /** * Test invalid crop argument */ @@ -455,7 +453,6 @@ public function testPostCroppedAvatarException() { $this->assertEquals($expectedResponse, $this->avatarController->postCroppedAvatar(['x' => 0, 'y' => 0, 'w' => 10, 'h' => 11])); } - /** * Check response when avatar is too big */ diff --git a/tests/Core/Controller/LostControllerTest.php b/tests/Core/Controller/LostControllerTest.php index f16ac8f10670..ac8808614529 100644 --- a/tests/Core/Controller/LostControllerTest.php +++ b/tests/Core/Controller/LostControllerTest.php @@ -173,7 +173,6 @@ public function testResetFormInvalidTokenMatch() { $this->assertEquals($expectedResponse, $response); } - public function testResetFormExpiredToken() { $user = $this->getMockBuilder('\OCP\IUser') ->disableOriginalConstructor()->getMock(); @@ -533,7 +532,6 @@ public function testSetPasswordSuccessful() { ->method('send') ->with($message); - $response = $this->lostController->setPassword('TheOnlyAndOnlyOneTokenToResetThePassword', 'ValidTokenUser', 'NewPassword', true); $expectedResponse = ['status' => 'success']; $this->assertSame($expectedResponse, $response); diff --git a/tests/Settings/Controller/CertificateControllerTest.php b/tests/Settings/Controller/CertificateControllerTest.php index 19b79511a3f8..61bb54a540d4 100644 --- a/tests/Settings/Controller/CertificateControllerTest.php +++ b/tests/Settings/Controller/CertificateControllerTest.php @@ -142,7 +142,6 @@ public function testAddPersonalRootCertificateValidCertificate() { ->with('date', new \DateTime('@1529099555')) ->will($this->returnValue('Valid Till as String')); - $expected = new DataResponse([ 'name' => 'Name', 'commonName' => 'CommonName', diff --git a/tests/Settings/Controller/CheckSetupControllerTest.php b/tests/Settings/Controller/CheckSetupControllerTest.php index 01beb572f2e6..06dc635e572c 100644 --- a/tests/Settings/Controller/CheckSetupControllerTest.php +++ b/tests/Settings/Controller/CheckSetupControllerTest.php @@ -131,7 +131,6 @@ public function testIsInternetConnectionWorkingCorrectly() { ->method('newClient') ->will($this->returnValue($client)); - $this->assertTrue( self::invokePrivate( $this->checkSetupController, @@ -478,7 +477,6 @@ public function testIsBuggyNss400() { $this->assertSame('cURL is using an outdated NSS version (NSS/1.0.2b). Please update your operating system or features such as installing and updating apps via the market or Federated Cloud Sharing will not work reliably.', $this->invokePrivate($this->checkSetupController, 'isUsedTlsLibOutdated')); } - public function testIsBuggyNss200() { $this->config->expects($this->any()) ->method('getSystemValue') @@ -596,7 +594,6 @@ public function testGetFailedIntegrityCheckDisabled() { $this->assertEquals($expected, $this->checkSetupController->getFailedIntegrityCheckFiles()); } - public function testGetFailedIntegrityCheckFilesWithNoErrorsFound() { $this->checker ->expects($this->once()) diff --git a/tests/Settings/Controller/SettingsPageControllerTest.php b/tests/Settings/Controller/SettingsPageControllerTest.php index c1c8a8fbe7f0..aeda7ab2326e 100644 --- a/tests/Settings/Controller/SettingsPageControllerTest.php +++ b/tests/Settings/Controller/SettingsPageControllerTest.php @@ -147,5 +147,4 @@ public function testGetPersonalAsAdmin() { $this->assertContains('testAdminSectionID', $response->getParams()['adminNav'][0]['id']); } - } \ No newline at end of file diff --git a/tests/acceptance/features/bootstrap/Trashbin.php b/tests/acceptance/features/bootstrap/Trashbin.php index b0f0e19115f1..e843d54d9654 100644 --- a/tests/acceptance/features/bootstrap/Trashbin.php +++ b/tests/acceptance/features/bootstrap/Trashbin.php @@ -62,7 +62,6 @@ public function listTrashbinFolder($user, $path) { ); $this->theHTTPStatusCodeShouldBe('200'); - $decodedResponse = \json_decode($this->response->getBody(), true); return $decodedResponse['data']['files']; diff --git a/tests/acceptance/features/bootstrap/WebDav.php b/tests/acceptance/features/bootstrap/WebDav.php index a0fb71ddc0af..a3f28a62e613 100644 --- a/tests/acceptance/features/bootstrap/WebDav.php +++ b/tests/acceptance/features/bootstrap/WebDav.php @@ -675,7 +675,6 @@ public function theSingleResponseShouldContainAPropertyWithValueLike( } } - /** * @Then the response should contain a share-types property with * @@ -917,7 +916,6 @@ public function reportElementComments($user, $path, $properties) { ' . $properties . ' '; - $response = $client->request( 'REPORT', $this->makeSabrePathNotForFiles($path), $body ); @@ -1278,7 +1276,6 @@ public function userUploadsAFileWithContentTo($user, $content, $destination) { } } - /** * @When user :user uploads file with checksum :checksum and content :content to :destination using the API * @Given user :user has uploaded file with checksum :checksum and content :content to :destination @@ -1308,7 +1305,6 @@ public function userUploadsAFileWithChecksumAndContentTo( } } - /** * @Given file :file has been deleted for user :user * diff --git a/tests/acceptance/features/bootstrap/WebUIFilesContext.php b/tests/acceptance/features/bootstrap/WebUIFilesContext.php index 0a6584f38994..8c9467429636 100644 --- a/tests/acceptance/features/bootstrap/WebUIFilesContext.php +++ b/tests/acceptance/features/bootstrap/WebUIFilesContext.php @@ -519,7 +519,6 @@ public function theFollowingFilesFoldersHaveBeenDeleted(TableNode $filesTable) { ); } - } } diff --git a/tests/acceptance/features/bootstrap/WebUILoginContext.php b/tests/acceptance/features/bootstrap/WebUILoginContext.php index 62d05c817bbb..31d82c76b74e 100644 --- a/tests/acceptance/features/bootstrap/WebUILoginContext.php +++ b/tests/acceptance/features/bootstrap/WebUILoginContext.php @@ -268,8 +268,6 @@ public function theUserResetsThePasswordToUsingTheWebui($newPassword) { $this->loginPage->resetThePassword($newPassword, $this->getSession()); } - - /** * This will run before EVERY scenario. * It will set the properties for this object. diff --git a/tests/acceptance/features/lib/FilesPageElement/SharingDialogElement/EditPublicLinkPopup.php b/tests/acceptance/features/lib/FilesPageElement/SharingDialogElement/EditPublicLinkPopup.php index 0c63aa62fdd9..1d9dec463b02 100644 --- a/tests/acceptance/features/lib/FilesPageElement/SharingDialogElement/EditPublicLinkPopup.php +++ b/tests/acceptance/features/lib/FilesPageElement/SharingDialogElement/EditPublicLinkPopup.php @@ -48,7 +48,6 @@ class EditPublicLinkPopup extends OwncloudPage { 'upload' => ".//label[contains(@for, 'sharingDialogAllowPublicUpload')]" ]; - /** * sets the NodeElement for the current popup * a little bit like __construct() but as we access this "sub-page-object" diff --git a/tests/lib/AppFramework/AppTest.php b/tests/lib/AppFramework/AppTest.php index f886b9c5e47a..e6401313f54b 100644 --- a/tests/lib/AppFramework/AppTest.php +++ b/tests/lib/AppFramework/AppTest.php @@ -21,13 +21,11 @@ * */ - namespace Test\AppFramework; use OC\AppFramework\App; use OCP\AppFramework\Http\Response; - function rrmdir($directory) { $files = \array_diff(\scandir($directory), ['.','..']); foreach ($files as $file) { @@ -40,7 +38,6 @@ function rrmdir($directory) { return \rmdir($directory); } - class AppTest extends \Test\TestCase { private $container; @@ -92,7 +89,6 @@ protected function setUp() { \file_put_contents($infoXmlPath, $xml); } - public function testControllerNameAndMethodAreBeingPassed(){ $return = [null, [], [], null, new Response()]; $this->dispatcher->expects($this->once()) @@ -108,31 +104,26 @@ public function testControllerNameAndMethodAreBeingPassed(){ $this->container); } - public function testBuildAppNamespace() { $ns = App::buildAppNamespace('someapp'); $this->assertEquals('OCA\Someapp', $ns); } - public function testBuildAppNamespaceCore() { $ns = App::buildAppNamespace('someapp', 'OC\\'); $this->assertEquals('OC\Someapp', $ns); } - public function testBuildAppNamespaceInfoXml() { $ns = App::buildAppNamespace('namespacetestapp', 'OCA\\'); $this->assertEquals('OCA\NameSpaceTestApp', $ns); } - protected function tearDown() { rrmdir($this->appPath); parent::tearDown(); } - public function testOutputIsPrinted(){ $return = [null, [], [], $this->output, new Response()]; $this->dispatcher->expects($this->once()) @@ -146,7 +137,6 @@ public function testOutputIsPrinted(){ App::main($this->controllerName, $this->controllerMethod, $this->container, []); } - public function testCallbackIsCalled(){ $mock = $this->getMockBuilder('OCP\AppFramework\Http\ICallbackResponse') ->getMock(); diff --git a/tests/lib/AppFramework/Controller/ApiControllerTest.php b/tests/lib/AppFramework/Controller/ApiControllerTest.php index d6dc7a7a8f6d..8efbae83e5af 100644 --- a/tests/lib/AppFramework/Controller/ApiControllerTest.php +++ b/tests/lib/AppFramework/Controller/ApiControllerTest.php @@ -21,16 +21,13 @@ * */ - namespace Test\AppFramework\Controller; use OC\AppFramework\Http\Request; use OCP\AppFramework\ApiController; - class ChildApiController extends ApiController {}; - class ApiControllerTest extends \Test\TestCase { /** @var ChildApiController */ protected $controller; diff --git a/tests/lib/AppFramework/Controller/ControllerTest.php b/tests/lib/AppFramework/Controller/ControllerTest.php index 016d31785b12..db0a67638f90 100644 --- a/tests/lib/AppFramework/Controller/ControllerTest.php +++ b/tests/lib/AppFramework/Controller/ControllerTest.php @@ -21,7 +21,6 @@ * */ - namespace Test\AppFramework\Controller; use OC\AppFramework\DependencyInjection\DIContainer; @@ -34,7 +33,6 @@ use OCP\Security\ISecureRandom; use Test\TestCase; - class ChildController extends Controller { public function __construct($appName, $request) { @@ -98,33 +96,26 @@ protected function setUp(){ $this->controller = new ChildController($this->app, $request); } - public function testParamsGet(){ $this->assertEquals('Johnny Weissmüller', $this->controller->params('name', 'Tarzan')); } - public function testParamsGetDefault(){ $this->assertEquals('Tarzan', $this->controller->params('Ape Man', 'Tarzan')); } - public function testParamsFile(){ $this->assertEquals('filevalue', $this->controller->params('file', 'filevalue')); } - public function testGetUploadedFile(){ $this->assertEquals('filevalue', $this->controller->getUploadedFile('file')); } - - public function testGetUploadedFileDefault(){ $this->assertEquals('default', $this->controller->params('files', 'default')); } - public function testGetParams(){ $params = [ 'name' => 'Johnny Weissmüller', @@ -134,12 +125,10 @@ public function testGetParams(){ $this->assertEquals($params, $this->controller->getParams()); } - public function testRender(){ $this->assertInstanceOf(TemplateResponse::class, $this->controller->render('')); } - public function testSetParams(){ $params = ['john' => 'foo']; $response = $this->controller->render('home', $params); @@ -147,7 +136,6 @@ public function testSetParams(){ $this->assertEquals($params, $response->getParams()); } - public function testRenderHeaders(){ $headers = ['one', 'two']; $response = $this->controller->render('', [], '', $headers); @@ -156,17 +144,14 @@ public function testRenderHeaders(){ $this->assertContains($headers[1], $response->getHeaders()); } - public function testGetRequestMethod(){ $this->assertEquals('hi', $this->controller->method()); } - public function testGetEnvVariable(){ $this->assertEquals('daheim', $this->controller->env('PATH')); } - /** * @expectedException \DomainException */ @@ -174,7 +159,6 @@ public function testFormatResonseInvalidFormat() { $this->controller->buildResponse(null, 'test'); } - public function testFormat() { /** @var DataResponse $response */ $response = $this->controller->buildResponse(['hi'], 'json'); @@ -182,7 +166,6 @@ public function testFormat() { $this->assertEquals(['hi'], $response->getData()); } - public function testFormatDataResponseJSON() { $expectedHeaders = [ 'test' => 'something', @@ -200,7 +183,6 @@ public function testFormatDataResponseJSON() { $this->assertEquals($expectedHeaders, $response->getHeaders()); } - public function testCustomFormatter() { $response = $this->controller->custom('hi'); /** @var DataResponse $response */ @@ -209,14 +191,12 @@ public function testCustomFormatter() { $this->assertEquals([2], $response->getData()); } - public function testDefaultResponderToJSON() { $responder = $this->controller->getResponderByHTTPHeader('*/*'); $this->assertEquals('json', $responder); } - public function testResponderAcceptHeaderParsed() { $responder = $this->controller->getResponderByHTTPHeader( '*/*, application/tom, application/json' @@ -225,7 +205,6 @@ public function testResponderAcceptHeaderParsed() { $this->assertEquals('tom', $responder); } - public function testResponderAcceptHeaderParsedUpperCase() { $responder = $this->controller->getResponderByHTTPHeader( '*/*, apPlication/ToM, application/json' @@ -234,5 +213,4 @@ public function testResponderAcceptHeaderParsedUpperCase() { $this->assertEquals('tom', $responder); } - } diff --git a/tests/lib/AppFramework/Controller/OCSControllerTest.php b/tests/lib/AppFramework/Controller/OCSControllerTest.php index 23198fa3b438..93c78f154581 100644 --- a/tests/lib/AppFramework/Controller/OCSControllerTest.php +++ b/tests/lib/AppFramework/Controller/OCSControllerTest.php @@ -21,7 +21,6 @@ * */ - namespace Test\AppFramework\Controller; use OC\AppFramework\Http\Request; @@ -32,10 +31,8 @@ use OCP\Security\ISecureRandom; use Test\TestCase; - class ChildOCSController extends OCSController {} - class OCSControllerTest extends TestCase { public function testCors() { @@ -62,7 +59,6 @@ public function testCors() { $this->assertEquals(100, $headers['Access-Control-Max-Age']); } - public function testXML() { $controller = new ChildOCSController('app', new Request( [ @@ -99,7 +95,6 @@ public function testXML() { $this->assertEquals($expected, $out); } - public function testXMLDataResponse() { $controller = new ChildOCSController('app', new Request( [ diff --git a/tests/lib/AppFramework/Db/EntityTest.php b/tests/lib/AppFramework/Db/EntityTest.php index a9abac42537e..667b2f308149 100644 --- a/tests/lib/AppFramework/Db/EntityTest.php +++ b/tests/lib/AppFramework/Db/EntityTest.php @@ -23,10 +23,8 @@ namespace Test\AppFramework\Db; - use OCP\AppFramework\Db\Entity; - /** * @method integer getId() * @method void setId(integer $id) @@ -51,7 +49,6 @@ public function __construct($name=null){ } }; - class EntityTest extends \Test\TestCase { private $entity; @@ -61,7 +58,6 @@ protected function setUp(){ $this->entity = new TestEntity(); } - public function testResetUpdatedFields(){ $entity = new TestEntity(); $entity->setId(3); @@ -70,7 +66,6 @@ public function testResetUpdatedFields(){ $this->assertEquals([], $entity->getUpdatedFields()); } - public function testFromRow(){ $row = [ 'pre_name' => 'john', @@ -82,7 +77,6 @@ public function testFromRow(){ $this->assertEquals($row['email'], $this->entity->getEmail()); } - public function testGetSetId(){ $id = 3; $this->entity->setId(3); @@ -90,56 +84,48 @@ public function testGetSetId(){ $this->assertEquals($id, $this->entity->getId()); } - public function testColumnToPropertyNoReplacement(){ $column = 'my'; $this->assertEquals('my', $this->entity->columnToProperty($column)); } - public function testColumnToProperty(){ $column = 'my_attribute'; $this->assertEquals('myAttribute', $this->entity->columnToProperty($column)); } - public function testPropertyToColumnNoReplacement(){ $property = 'my'; $this->assertEquals('my', $this->entity->propertyToColumn($property)); } - public function testSetterMarksFieldUpdated(){ $this->entity->setId(3); $this->assertContains('id', $this->entity->getUpdatedFields()); } - public function testCallShouldOnlyWorkForGetterSetter(){ $this->setExpectedException('\BadFunctionCallException'); $this->entity->something(); } - public function testGetterShouldFailIfAttributeNotDefined(){ $this->setExpectedException('\BadFunctionCallException'); $this->entity->getTest(); } - public function testSetterShouldFailIfAttributeNotDefined(){ $this->setExpectedException('\BadFunctionCallException'); $this->entity->setTest(); } - public function testFromRowShouldNotAssignEmptyArray(){ $row = []; $entity2 = new TestEntity(); @@ -148,7 +134,6 @@ public function testFromRowShouldNotAssignEmptyArray(){ $this->assertEquals($entity2, $this->entity); } - public function testIdGetsConvertedToInt(){ $row = ['id' => '4']; @@ -156,7 +141,6 @@ public function testIdGetsConvertedToInt(){ $this->assertSame(4, $this->entity->getId()); } - public function testSetType(){ $row = ['testId' => '4']; @@ -164,7 +148,6 @@ public function testSetType(){ $this->assertSame(4, $this->entity->getTestId()); } - public function testFromParams(){ $params = [ 'testId' => 4, @@ -186,21 +169,18 @@ public function testSlugify(){ $this->assertEquals('slugify-this', $entity->slugify('name')); } - public function testSetterCasts() { $entity = new TestEntity(); $entity->setId('3'); $this->assertSame(3, $entity->getId()); } - public function testSetterDoesNotCastOnNull() { $entity = new TestEntity(); $entity->setId(null); $this->assertNull($entity->getId()); } - public function testGetFieldTypes() { $entity = new TestEntity(); $this->assertEquals([ @@ -209,19 +189,16 @@ public function testGetFieldTypes() { ], $entity->getFieldTypes()); } - public function testGetItInt() { $entity = new TestEntity(); $entity->setId(3); $this->assertEquals('integer', \gettype($entity->getId())); } - public function testFieldsNotMarkedUpdatedIfNothingChanges() { $entity = new TestEntity('hey'); $entity->setName('hey'); $this->assertCount(0, $entity->getUpdatedFields()); } - } diff --git a/tests/lib/AppFramework/Db/MapperTest.php b/tests/lib/AppFramework/Db/MapperTest.php index a3ebfd3d0fe7..0eb873fa6e8a 100644 --- a/tests/lib/AppFramework/Db/MapperTest.php +++ b/tests/lib/AppFramework/Db/MapperTest.php @@ -21,7 +21,6 @@ * */ - namespace Test\AppFramework\Db; use OCP\AppFramework\Db\Entity; @@ -41,7 +40,6 @@ class Example extends Entity { protected $email; }; - class ExampleMapper extends Mapper { public function __construct(IDBConnection $db){ parent::__construct($db, 'table'); } public function find($table, $id){ return $this->findOneQuery($table, $id); } @@ -51,7 +49,6 @@ public function mapRow($row){ return $this->mapRowToEntity($row); } public function execSql($sql, $params){ return $this->execute($sql, $params); } } - class MapperTest extends MapperTestUtility { /** @@ -64,12 +61,10 @@ protected function setUp(){ $this->mapper = new ExampleMapper($this->db); } - public function testMapperShouldSetTableName(){ $this->assertEquals('*PREFIX*table', $this->mapper->getTableName()); } - public function testFindQuery(){ $sql = 'hi'; $params = ['jo']; @@ -134,7 +129,6 @@ public function testFindEntityMultiple(){ $this->mapper->findOneEntity($sql, $params); } - public function testDelete(){ $sql = 'DELETE FROM `*PREFIX*table` WHERE `id` = ?'; $params = [2]; @@ -146,7 +140,6 @@ public function testDelete(){ $this->mapper->delete($entity); } - public function testCreate(){ $this->db->expects($this->once()) ->method('lastInsertId') @@ -166,7 +159,6 @@ public function testCreate(){ $this->mapper->insert($entity); } - public function testCreateShouldReturnItemWithCorrectInsertId(){ $this->db->expects($this->once()) ->method('lastInsertId') @@ -188,7 +180,6 @@ public function testCreateShouldReturnItemWithCorrectInsertId(){ $this->assertEquals(3, $result->getId()); } - public function testAssocParameters() { $sql = 'test'; $params = [':test' => 1, ':a' => 2]; @@ -197,7 +188,6 @@ public function testAssocParameters() { $this->mapper->execSql($sql, $params); } - public function testUpdate(){ $sql = 'UPDATE `*PREFIX*table` ' . 'SET ' . @@ -216,7 +206,6 @@ public function testUpdate(){ $this->mapper->update($entity); } - public function testUpdateNoId(){ $params = ['john', 'my@email']; $entity = new Example(); @@ -228,7 +217,6 @@ public function testUpdateNoId(){ $this->mapper->update($entity); } - public function testUpdateNothingChangedNoQuery(){ $params = ['john', 'my@email']; $entity = new Example(); @@ -242,7 +230,6 @@ public function testUpdateNothingChangedNoQuery(){ $this->mapper->update($entity); } - public function testMapRowToEntity(){ $entity1 = $this->mapper->mapRow(['pre_name' => 'test1', 'email' => 'test2']); $entity2 = new Example(); diff --git a/tests/lib/AppFramework/Db/MapperTestUtility.php b/tests/lib/AppFramework/Db/MapperTestUtility.php index 0ff50e91bf98..fd740c4e83d1 100644 --- a/tests/lib/AppFramework/Db/MapperTestUtility.php +++ b/tests/lib/AppFramework/Db/MapperTestUtility.php @@ -21,10 +21,8 @@ * */ - namespace Test\AppFramework\Db; - /** * Simple utility class for testing mappers */ @@ -36,7 +34,6 @@ abstract class MapperTestUtility extends \Test\TestCase { private $fetchAt; private $iterators; - /** * Run this function before the actual test to either set or initialize the * db. After this the db can be accessed by using $this->db @@ -171,8 +168,6 @@ function() use ($iterators, $fetchAt){ })); $this->queryAt++; - - if ($expectClose) { $closing = $this->at($this->queryAt); } else { @@ -185,10 +180,8 @@ function() use ($iterators, $fetchAt){ $this->fetchAt++; } - } - class ArgumentIterator { private $arguments; diff --git a/tests/lib/AppFramework/DependencyInjection/DIContainerTest.php b/tests/lib/AppFramework/DependencyInjection/DIContainerTest.php index f987fa5363a1..71c597262a5c 100644 --- a/tests/lib/AppFramework/DependencyInjection/DIContainerTest.php +++ b/tests/lib/AppFramework/DependencyInjection/DIContainerTest.php @@ -23,10 +23,8 @@ * */ - namespace Test\AppFramework\DependencyInjection; - use OC\AppFramework\Http\Request; class DIContainerTest extends \Test\TestCase { @@ -49,32 +47,26 @@ public function testProvidesAPI(){ $this->assertTrue(isset($this->container['API'])); } - public function testProvidesRequest(){ $this->assertTrue(isset($this->container['Request'])); } - public function testProvidesSecurityMiddleware(){ $this->assertTrue(isset($this->container['SecurityMiddleware'])); } - public function testProvidesMiddlewareDispatcher(){ $this->assertTrue(isset($this->container['MiddlewareDispatcher'])); } - public function testProvidesAppName(){ $this->assertTrue(isset($this->container['AppName'])); } - public function testAppNameIsSetCorrectly(){ $this->assertEquals('name', $this->container['AppName']); } - public function testMiddlewareDispatcherIncludesSecurityMiddleware(){ $this->container['Request'] = new Request( ['method' => 'GET'], @@ -87,5 +79,4 @@ public function testMiddlewareDispatcherIncludesSecurityMiddleware(){ $this->assertContains($security, $dispatcher->getMiddlewares()); } - } diff --git a/tests/lib/AppFramework/Http/ContentSecurityPolicyTest.php b/tests/lib/AppFramework/Http/ContentSecurityPolicyTest.php index e8f5350fe1f1..469bf3b7962d 100644 --- a/tests/lib/AppFramework/Http/ContentSecurityPolicyTest.php +++ b/tests/lib/AppFramework/Http/ContentSecurityPolicyTest.php @@ -6,7 +6,6 @@ * See the COPYING-README file. */ - namespace Test\AppFramework\Http; use OCP\AppFramework\Http\ContentSecurityPolicy; diff --git a/tests/lib/AppFramework/Http/DataResponseTest.php b/tests/lib/AppFramework/Http/DataResponseTest.php index e419fcfe564a..e989d4027ca5 100644 --- a/tests/lib/AppFramework/Http/DataResponseTest.php +++ b/tests/lib/AppFramework/Http/DataResponseTest.php @@ -21,15 +21,12 @@ * */ - namespace Test\AppFramework\Http; - use OCP\AppFramework\Http; use OCP\AppFramework\Http\DataResponse; use Test\TestCase; - class DataResponseTest extends TestCase { /** @@ -42,7 +39,6 @@ protected function setUp() { $this->response = new DataResponse(); } - public function testSetData() { $params = ['hi', 'yo']; $this->response->setData($params); @@ -50,7 +46,6 @@ public function testSetData() { $this->assertEquals(['hi', 'yo'], $this->response->getData()); } - public function testConstructorAllowsToSetData() { $data = ['hi']; $code = 300; @@ -60,7 +55,6 @@ public function testConstructorAllowsToSetData() { $this->assertEquals($code, $response->getStatus()); } - public function testConstructorAllowsToSetHeaders() { $data = ['hi']; $code = 300; @@ -78,7 +72,6 @@ public function testConstructorAllowsToSetHeaders() { $this->assertEquals($expectedHeaders, $response->getHeaders()); } - public function testChainability() { $params = ['hi', 'yo']; $this->response->setData($params) @@ -88,5 +81,4 @@ public function testChainability() { $this->assertEquals(['hi', 'yo'], $this->response->getData()); } - } diff --git a/tests/lib/AppFramework/Http/DispatcherTest.php b/tests/lib/AppFramework/Http/DispatcherTest.php index 48b86f01e0f5..c2fd07c4de87 100644 --- a/tests/lib/AppFramework/Http/DispatcherTest.php +++ b/tests/lib/AppFramework/Http/DispatcherTest.php @@ -21,7 +21,6 @@ * */ - namespace Test\AppFramework\Http; use OC\AppFramework\Http; @@ -34,7 +33,6 @@ use OCP\AppFramework\Http\JSONResponse; use OCP\AppFramework\Http\Response; - class TestController extends Controller { /** * @param string $appName @@ -58,7 +56,6 @@ public function exec($int, $bool, $test=4, $test2=1) { return [$int, $bool, $test, $test2]; } - /** * @param int $int * @param bool $bool @@ -74,7 +71,6 @@ public function execDataResponse($int, $bool, $test=4, $test2=1) { } - class DispatcherTest extends \Test\TestCase { /** @var MiddlewareDispatcher | \PHPUnit_Framework_MockObject_MockObject */ private $middlewareDispatcher; @@ -140,7 +136,6 @@ protected function setUp() { $this->etag = 'hi'; } - /** * @param string $out * @param string $httpHeaders @@ -226,7 +221,6 @@ private function setMiddlewareExpectations($out=null, ->will($this->returnValue($out)); } - public function testDispatcherReturnsArrayWith2Entries() { $this->setMiddlewareExpectations(); @@ -237,7 +231,6 @@ public function testDispatcherReturnsArrayWith2Entries() { $this->assertNull($response[2]); } - public function testHeadersAndOutputAreReturned(){ $out = 'yo'; $httpHeaders = 'Http'; @@ -252,7 +245,6 @@ public function testHeadersAndOutputAreReturned(){ $this->assertEquals($out, $response[3]); } - public function testExceptionCallsAfterException() { $out = 'yo'; $httpHeaders = 'Http'; @@ -267,7 +259,6 @@ public function testExceptionCallsAfterException() { $this->assertEquals($out, $response[3]); } - public function testExceptionThrowsIfCanNotBeHandledByAfterException() { $out = 'yo'; $httpHeaders = 'Http'; @@ -280,7 +271,6 @@ public function testExceptionThrowsIfCanNotBeHandledByAfterException() { } - private function dispatcherPassthrough() { $this->middlewareDispatcher->expects($this->once()) ->method('beforeController'); @@ -296,7 +286,6 @@ private function dispatcherPassthrough() { })); } - public function testControllerParametersInjected() { $this->request = new Request( [ @@ -322,7 +311,6 @@ public function testControllerParametersInjected() { $this->assertEquals('[3,true,4,1]', $response[3]); } - public function testControllerParametersInjectedDefaultOverwritten() { $this->request = new Request( [ @@ -349,8 +337,6 @@ public function testControllerParametersInjectedDefaultOverwritten() { $this->assertEquals('[3,true,4,7]', $response[3]); } - - public function testResponseTransformedByUrlFormat() { $this->request = new Request( [ @@ -379,7 +365,6 @@ public function testResponseTransformedByUrlFormat() { $this->assertEquals('{"text":[3,false,4,1]}', $response[3]); } - public function testResponseTransformsDataResponse() { $this->request = new Request( [ @@ -408,7 +393,6 @@ public function testResponseTransformsDataResponse() { $this->assertEquals('{"text":[3,false,4,1]}', $response[3]); } - public function testResponseTransformedByAcceptHeader() { $this->request = new Request( [ @@ -438,7 +422,6 @@ public function testResponseTransformedByAcceptHeader() { $this->assertEquals('{"text":[3,false,4,1]}', $response[3]); } - public function testResponsePrimarilyTransformedByParameterFormat() { $this->request = new Request( [ @@ -470,7 +453,4 @@ public function testResponsePrimarilyTransformedByParameterFormat() { $this->assertEquals('{"text":[3,true,4,1]}', $response[3]); } - - - } diff --git a/tests/lib/AppFramework/Http/DownloadResponseTest.php b/tests/lib/AppFramework/Http/DownloadResponseTest.php index 1bd7fd3e6a50..91f4c6b5ea39 100644 --- a/tests/lib/AppFramework/Http/DownloadResponseTest.php +++ b/tests/lib/AppFramework/Http/DownloadResponseTest.php @@ -21,17 +21,14 @@ * */ - namespace Test\AppFramework\Http; - use OCP\AppFramework\Http\DownloadResponse; class ChildDownloadResponse extends DownloadResponse { }; - class DownloadResponseTest extends \Test\TestCase { /** @@ -44,7 +41,6 @@ protected function setUp(){ $this->response = new ChildDownloadResponse('file', 'content'); } - public function testHeaders() { $headers = $this->response->getHeaders(); @@ -52,5 +48,4 @@ public function testHeaders() { $this->assertContains('content', $headers['Content-Type']); } - } diff --git a/tests/lib/AppFramework/Http/EmptyContentSecurityPolicyTest.php b/tests/lib/AppFramework/Http/EmptyContentSecurityPolicyTest.php index e625fbb97bb8..579994e5800e 100644 --- a/tests/lib/AppFramework/Http/EmptyContentSecurityPolicyTest.php +++ b/tests/lib/AppFramework/Http/EmptyContentSecurityPolicyTest.php @@ -6,7 +6,6 @@ * See the COPYING-README file. */ - namespace Test\AppFramework\Http; use OCP\AppFramework\Http\EmptyContentSecurityPolicy; diff --git a/tests/lib/AppFramework/Http/HttpTest.php b/tests/lib/AppFramework/Http/HttpTest.php index 90c00de9ca06..0d9b0c28f043 100644 --- a/tests/lib/AppFramework/Http/HttpTest.php +++ b/tests/lib/AppFramework/Http/HttpTest.php @@ -21,12 +21,10 @@ * */ - namespace Test\AppFramework\Http; use OC\AppFramework\Http; - class HttpTest extends \Test\TestCase { private $server; @@ -43,20 +41,17 @@ protected function setUp(){ $this->http = new Http($this->server); } - public function testProtocol() { $header = $this->http->getStatusHeader(Http::STATUS_TEMPORARY_REDIRECT); $this->assertEquals('HTTP/1.1 307 Temporary Redirect', $header); } - public function testProtocol10() { $this->http = new Http($this->server, 'HTTP/1.0'); $header = $this->http->getStatusHeader(Http::STATUS_OK); $this->assertEquals('HTTP/1.0 200 OK', $header); } - public function testEtagMatchReturnsNotModified() { $http = new Http(['HTTP_IF_NONE_MATCH' => 'hi']); @@ -64,7 +59,6 @@ public function testEtagMatchReturnsNotModified() { $this->assertEquals('HTTP/1.1 304 Not Modified', $header); } - public function testQuotedEtagMatchReturnsNotModified() { $http = new Http(['HTTP_IF_NONE_MATCH' => '"hi"']); @@ -72,7 +66,6 @@ public function testQuotedEtagMatchReturnsNotModified() { $this->assertEquals('HTTP/1.1 304 Not Modified', $header); } - public function testLastModifiedMatchReturnsNotModified() { $dateTime = new \DateTime(null, new \DateTimeZone('GMT')); $dateTime->setTimestamp('12'); @@ -86,8 +79,6 @@ public function testLastModifiedMatchReturnsNotModified() { $this->assertEquals('HTTP/1.1 304 Not Modified', $header); } - - public function testTempRedirectBecomesFoundInHttp10() { $http = new Http([], 'HTTP/1.0'); diff --git a/tests/lib/AppFramework/Http/JSONResponseTest.php b/tests/lib/AppFramework/Http/JSONResponseTest.php index 8e1d7ad73c13..e7be53122d35 100644 --- a/tests/lib/AppFramework/Http/JSONResponseTest.php +++ b/tests/lib/AppFramework/Http/JSONResponseTest.php @@ -23,10 +23,8 @@ * */ - namespace Test\AppFramework\Http; - use OCP\AppFramework\Http; use OCP\AppFramework\Http\JSONResponse; @@ -42,13 +40,11 @@ protected function setUp() { $this->json = new JSONResponse(); } - public function testHeader() { $headers = $this->json->getHeaders(); $this->assertEquals('application/json; charset=utf-8', $headers['Content-Type']); } - public function testSetData() { $params = ['hi', 'yo']; $this->json->setData($params); @@ -56,7 +52,6 @@ public function testSetData() { $this->assertEquals(['hi', 'yo'], $this->json->getData()); } - public function testSetRender() { $params = ['test' => 'hi']; $this->json->setData($params); diff --git a/tests/lib/AppFramework/Http/OCSResponseTest.php b/tests/lib/AppFramework/Http/OCSResponseTest.php index abe3dee218d8..6b696cd479b9 100644 --- a/tests/lib/AppFramework/Http/OCSResponseTest.php +++ b/tests/lib/AppFramework/Http/OCSResponseTest.php @@ -21,30 +21,24 @@ * */ - namespace Test\AppFramework\Http; - use OCP\AppFramework\Http\OCSResponse; - class OCSResponseTest extends \Test\TestCase { - public function testHeadersJSON() { $response = new OCSResponse('json', 1, 2, 3); $type = $response->getHeaders()['Content-Type']; $this->assertEquals('application/json; charset=utf-8', $type); } - public function testHeadersXML() { $response = new OCSResponse('xml', 1, 2, 3); $type = $response->getHeaders()['Content-Type']; $this->assertEquals('application/xml; charset=utf-8', $type); } - public function testRender() { $response = new OCSResponse( 'xml', 2, 'message', ['test' => 'hi'], 3, 4 @@ -68,5 +62,4 @@ public function testRender() { } - } diff --git a/tests/lib/AppFramework/Http/RedirectResponseTest.php b/tests/lib/AppFramework/Http/RedirectResponseTest.php index e7983cf144f5..f78f89d60597 100644 --- a/tests/lib/AppFramework/Http/RedirectResponseTest.php +++ b/tests/lib/AppFramework/Http/RedirectResponseTest.php @@ -21,13 +21,11 @@ * */ - namespace Test\AppFramework\Http; use OCP\AppFramework\Http; use OCP\AppFramework\Http\RedirectResponse; - class RedirectResponseTest extends \Test\TestCase { /** @@ -40,7 +38,6 @@ protected function setUp(){ $this->response = new RedirectResponse('/url'); } - public function testHeaders() { $headers = $this->response->getHeaders(); $this->assertEquals('/url', $headers['Location']); @@ -48,10 +45,8 @@ public function testHeaders() { $this->response->getStatus()); } - public function testGetRedirectUrl(){ $this->assertEquals('/url', $this->response->getRedirectUrl()); } - } diff --git a/tests/lib/AppFramework/Http/RequestTest.php b/tests/lib/AppFramework/Http/RequestTest.php index aef7b2e0ce17..bc352f2676b4 100644 --- a/tests/lib/AppFramework/Http/RequestTest.php +++ b/tests/lib/AppFramework/Http/RequestTest.php @@ -104,7 +104,6 @@ public function testPrecedence() { $this->assertSame('Johnny Weissmüller', $request->{'name'}); } - /** * @expectedException \RuntimeException */ @@ -332,7 +331,6 @@ public function testPutStream() { } - public function testSetUrlParameters() { $vars = [ 'post' => [], @@ -699,7 +697,6 @@ public function testGetServerProtocolWithProtoValid() { $this->stream ); - $this->assertSame('https', $requestHttps->getServerProtocol()); $this->assertSame('http', $requestHttp->getServerProtocol()); } diff --git a/tests/lib/AppFramework/Http/ResponseTest.php b/tests/lib/AppFramework/Http/ResponseTest.php index 328e85688ed2..b36017b40a67 100644 --- a/tests/lib/AppFramework/Http/ResponseTest.php +++ b/tests/lib/AppFramework/Http/ResponseTest.php @@ -21,10 +21,8 @@ * */ - namespace Test\AppFramework\Http; - use DateTime; use DateTimeZone; use OCP\AppFramework\Http; @@ -32,7 +30,6 @@ use OCP\AppFramework\Http\Response; use Test\TestCase; - class ResponseTest extends TestCase { /** @@ -45,14 +42,12 @@ protected function setUp(){ $this->childResponse = new Response(); } - public function testAddHeader(){ $this->childResponse->addHeader(' hello ', 'world'); $headers = $this->childResponse->getHeaders(); $this->assertEquals('world', $headers['hello']); } - public function testSetHeaders() { $expected = [ 'Last-Modified' => 1, @@ -98,13 +93,11 @@ public function testAddHeaderValueNullDeletesIt(){ $this->assertCount(2, $this->childResponse->getHeaders()); } - public function testCacheHeadersAreDisabledByDefault(){ $headers = $this->childResponse->getHeaders(); $this->assertEquals('no-cache, must-revalidate', $headers['Cache-Control']); } - public function testAddCookie() { $this->childResponse->addCookie('foo', 'bar'); $this->childResponse->addCookie('bar', 'foo', new DateTime('1970-01-01')); @@ -122,7 +115,6 @@ public function testAddCookie() { $this->assertEquals($expectedResponse, $this->childResponse->getCookies()); } - function testSetCookies() { $expected = [ 'foo' => [ @@ -141,7 +133,6 @@ function testSetCookies() { $this->assertEquals($expected, $cookies); } - function testInvalidateCookie() { $this->childResponse->addCookie('foo', 'bar'); $this->childResponse->invalidateCookie('foo'); @@ -157,7 +148,6 @@ function testInvalidateCookie() { $this->assertEquals($expected, $cookies); } - function testInvalidateCookies() { $this->childResponse->addCookie('foo', 'bar'); $this->childResponse->addCookie('bar', 'foo'); @@ -190,12 +180,10 @@ function testInvalidateCookies() { $this->assertEquals($expected, $cookies); } - public function testRenderReturnNullByDefault(){ $this->assertNull($this->childResponse->render()); } - public function testGetStatus() { $default = $this->childResponse->getStatus(); @@ -205,13 +193,11 @@ public function testGetStatus() { $this->assertEquals(Http::STATUS_NOT_FOUND, $this->childResponse->getStatus()); } - public function testGetEtag() { $this->childResponse->setETag('hi'); $this->assertSame('hi', $this->childResponse->getETag()); } - public function testGetLastModified() { $lastModified = new DateTime(null, new DateTimeZone('GMT')); $lastModified->setTimestamp(1); @@ -219,8 +205,6 @@ public function testGetLastModified() { $this->assertEquals($lastModified, $this->childResponse->getLastModified()); } - - public function testCacheSecondsZero() { $this->childResponse->cacheFor(0); @@ -228,7 +212,6 @@ public function testCacheSecondsZero() { $this->assertEquals('no-cache, no-store, must-revalidate', $headers['Cache-Control']); } - public function testCacheSeconds() { $this->childResponse->cacheFor(33); @@ -237,8 +220,6 @@ public function testCacheSeconds() { $headers['Cache-Control']); } - - public function testEtagLastModifiedHeaders() { $lastModified = new DateTime(null, new DateTimeZone('GMT')); $lastModified->setTimestamp(1); diff --git a/tests/lib/AppFramework/Http/StreamResponseTest.php b/tests/lib/AppFramework/Http/StreamResponseTest.php index 36c3ec99dce4..c56dc07f4491 100644 --- a/tests/lib/AppFramework/Http/StreamResponseTest.php +++ b/tests/lib/AppFramework/Http/StreamResponseTest.php @@ -21,15 +21,12 @@ * */ - namespace Test\AppFramework\Http; - use OCP\AppFramework\Http; use OCP\AppFramework\Http\IOutput; use OCP\AppFramework\Http\StreamResponse; - class StreamResponseTest extends \Test\TestCase { /** @var IOutput */ diff --git a/tests/lib/AppFramework/Http/TemplateResponseTest.php b/tests/lib/AppFramework/Http/TemplateResponseTest.php index d25a364c9007..9b8b2fa6ebce 100644 --- a/tests/lib/AppFramework/Http/TemplateResponseTest.php +++ b/tests/lib/AppFramework/Http/TemplateResponseTest.php @@ -21,7 +21,6 @@ * */ - namespace Test\AppFramework\Http; use OCP\AppFramework\Http; @@ -29,7 +28,6 @@ use Test\TestCase; use OC\AppFramework\Core\API; - /** * Class TemplateResponseTest * @@ -60,7 +58,6 @@ public function testSetParams(){ $this->assertEquals(['hi' => 'yo'], $tpl->getParams()); } - public function testGetTemplateName(){ $tpl = new TemplateResponse('app', 'home'); $this->assertEquals('home', $tpl->getTemplateName()); diff --git a/tests/lib/AppFramework/Middleware/MiddlewareDispatcherTest.php b/tests/lib/AppFramework/Middleware/MiddlewareDispatcherTest.php index caa6e903d3a6..86cbe7211489 100644 --- a/tests/lib/AppFramework/Middleware/MiddlewareDispatcherTest.php +++ b/tests/lib/AppFramework/Middleware/MiddlewareDispatcherTest.php @@ -21,7 +21,6 @@ * */ - namespace Test\AppFramework\Middleware; use OC\AppFramework\Http\Request; @@ -29,7 +28,6 @@ use OCP\AppFramework\Http\Response; use OCP\AppFramework\Middleware; - // needed to test ordering class TestMiddleware extends Middleware { public static $beforeControllerCalled = 0; @@ -99,7 +97,6 @@ public function beforeOutput($controller, $methodName, $output){ } } - class MiddlewareDispatcherTest extends \Test\TestCase { public $exception; @@ -124,7 +121,6 @@ protected function setUp() { $this->exception = new \Exception(); } - private function getControllerMock(){ return $this->createMock( 'OCP\AppFramework\Controller', @@ -139,14 +135,12 @@ private function getControllerMock(){ ); } - private function getMiddleware($beforeControllerThrowsEx=false){ $m1 = new TestMiddleware($beforeControllerThrowsEx); $this->dispatcher->registerMiddleware($m1); return $m1; } - public function testAfterExceptionShouldReturnResponseOfMiddleware(){ $response = new Response(); $m1 = $this->createMock('\OCP\AppFramework\Middleware', @@ -167,7 +161,6 @@ public function testAfterExceptionShouldReturnResponseOfMiddleware(){ $this->assertEquals($response, $this->dispatcher->afterException($this->controller, $this->method, $this->exception)); } - public function testAfterExceptionShouldThrowAgainWhenNotHandled(){ $m1 = new TestMiddleware(false); $m2 = new TestMiddleware(true); @@ -180,7 +173,6 @@ public function testAfterExceptionShouldThrowAgainWhenNotHandled(){ $this->dispatcher->afterException($this->controller, $this->method, $this->exception); } - public function testBeforeControllerCorrectArguments(){ $m1 = $this->getMiddleware(); $this->dispatcher->beforeController($this->controller, $this->method); @@ -189,7 +181,6 @@ public function testBeforeControllerCorrectArguments(){ $this->assertEquals($this->method, $m1->methodName); } - public function testAfterControllerCorrectArguments(){ $m1 = $this->getMiddleware(); @@ -200,7 +191,6 @@ public function testAfterControllerCorrectArguments(){ $this->assertEquals($this->response, $m1->response); } - public function testAfterExceptionCorrectArguments(){ $m1 = $this->getMiddleware(); @@ -214,7 +204,6 @@ public function testAfterExceptionCorrectArguments(){ $this->assertEquals($this->exception, $m1->exception); } - public function testBeforeOutputCorrectArguments(){ $m1 = $this->getMiddleware(); @@ -225,7 +214,6 @@ public function testBeforeOutputCorrectArguments(){ $this->assertEquals($this->out, $m1->output); } - public function testBeforeControllerOrder(){ $m1 = $this->getMiddleware(); $m2 = $this->getMiddleware(); @@ -246,7 +234,6 @@ public function testAfterControllerOrder(){ $this->assertEquals(1, $m2->afterControllerOrder); } - public function testAfterExceptionOrder(){ $m1 = $this->getMiddleware(); $m2 = $this->getMiddleware(); @@ -259,7 +246,6 @@ public function testAfterExceptionOrder(){ $this->assertEquals(1, $m2->afterExceptionOrder); } - public function testBeforeOutputOrder(){ $m1 = $this->getMiddleware(); $m2 = $this->getMiddleware(); @@ -270,7 +256,6 @@ public function testBeforeOutputOrder(){ $this->assertEquals(1, $m2->beforeOutputOrder); } - public function testExceptionShouldRunAfterExceptionOfOnlyPreviouslyExecutedMiddlewares(){ $m1 = $this->getMiddleware(); $m2 = $this->getMiddleware(true); diff --git a/tests/lib/AppFramework/Middleware/MiddlewareTest.php b/tests/lib/AppFramework/Middleware/MiddlewareTest.php index 3c0433141317..046b8f0d9e87 100644 --- a/tests/lib/AppFramework/Middleware/MiddlewareTest.php +++ b/tests/lib/AppFramework/Middleware/MiddlewareTest.php @@ -21,7 +21,6 @@ * */ - namespace Test\AppFramework\Middleware; use OC\AppFramework\Http\Request; @@ -30,7 +29,6 @@ class ChildMiddleware extends Middleware {}; - class MiddlewareTest extends \Test\TestCase { /** @@ -69,31 +67,26 @@ protected function setUp(){ $this->response = $this->createMock('OCP\AppFramework\Http\Response'); } - public function testBeforeController() { $this->middleware->beforeController($this->controller, null); $this->assertNull(null); } - public function testAfterExceptionRaiseAgainWhenUnhandled() { $this->setExpectedException('Exception'); $afterEx = $this->middleware->afterException($this->controller, null, $this->exception); } - public function testAfterControllerReturnResponseWhenUnhandled() { $response = $this->middleware->afterController($this->controller, null, $this->response); $this->assertEquals($this->response, $response); } - public function testBeforeOutputReturnOutputhenUnhandled() { $output = $this->middleware->beforeOutput($this->controller, null, 'test'); $this->assertEquals('test', $output); } - } diff --git a/tests/lib/AppFramework/Middleware/Security/CORSMiddlewareTest.php b/tests/lib/AppFramework/Middleware/Security/CORSMiddlewareTest.php index 802f5ab6a836..cf0fe867e5df 100644 --- a/tests/lib/AppFramework/Middleware/Security/CORSMiddlewareTest.php +++ b/tests/lib/AppFramework/Middleware/Security/CORSMiddlewareTest.php @@ -9,7 +9,6 @@ * @copyright Bernhard Posselt 2014 */ - namespace Test\AppFramework\Middleware\Security; use OC\AppFramework\Http\Request; @@ -22,7 +21,6 @@ use OCP\IUser; use OCP\IUserSession; - /** * Class CORSMiddlewareTest */ @@ -79,7 +77,6 @@ public function testSetCORSAPIHeader() { $this->assertEquals('http://www.test.com', $headers['Access-Control-Allow-Origin']); } - public function testNoAnnotationNoCORSHEADER() { $request = new Request( [ @@ -102,7 +99,6 @@ public function testNoAnnotationNoCORSHEADER() { $this->assertArrayNotHasKey('Access-Control-Allow-Origin', $headers); } - /** * @CORS */ @@ -125,7 +121,6 @@ public function testNoOriginHeaderNoCORSHEADER() { $this->assertArrayNotHasKey('Access-Control-Allow-Origin', $headers); } - /** * @CORS * @expectedException \OC\AppFramework\Middleware\Security\Exceptions\SecurityException diff --git a/tests/lib/AppFramework/Middleware/Security/SecurityMiddlewareTest.php b/tests/lib/AppFramework/Middleware/Security/SecurityMiddlewareTest.php index a53b5968ede0..e3a12b15edd7 100644 --- a/tests/lib/AppFramework/Middleware/Security/SecurityMiddlewareTest.php +++ b/tests/lib/AppFramework/Middleware/Security/SecurityMiddlewareTest.php @@ -20,8 +20,6 @@ * */ - - namespace Test\AppFramework\Middleware\Security; use OC\AppFramework\Http; @@ -51,7 +49,6 @@ use OCP\INavigationManager; use OCP\ILogger; - class SecurityMiddlewareTest extends TestCase { /** @var SecurityMiddleware */ @@ -128,7 +125,6 @@ private function getMiddleware($isLoggedIn, $isAdminUser) { ); } - /** * @PublicPage * @NoCSRFRequired @@ -144,7 +140,6 @@ public function testSetNavigationEntry(){ $this->middleware->beforeController(__CLASS__, __FUNCTION__); } - /** * @param string $method * @param string $test @@ -242,7 +237,6 @@ public function testAjaxStatusAllGood() { ); } - /** * @PublicPage * @NoCSRFRequired @@ -260,7 +254,6 @@ public function testNoChecks(){ $sec->beforeController(__CLASS__, __FUNCTION__); } - /** * @param string $method * @param string $expects @@ -290,7 +283,6 @@ private function securityCheck($method, $expects, $shouldFail=false){ $sec->beforeController(__CLASS__, $method); } - /** * @PublicPage * @expectedException \OC\AppFramework\Middleware\Security\Exceptions\CrossSiteRequestForgeryException @@ -306,7 +298,6 @@ public function testCsrfCheck(){ $this->middleware->beforeController(__CLASS__, __FUNCTION__); } - /** * @PublicPage * @NoCSRFRequired @@ -322,7 +313,6 @@ public function testNoCsrfCheck(){ $this->middleware->beforeController(__CLASS__, __FUNCTION__); } - /** * @PublicPage * @throws SecurityException @@ -337,7 +327,6 @@ public function testFailCsrfCheck(){ $this->middleware->beforeController(__CLASS__, __FUNCTION__); } - /** * @NoCSRFRequired * @NoAdminRequired @@ -348,7 +337,6 @@ public function testLoggedInCheck(){ $this->securityCheck(__FUNCTION__, 'isLoggedIn'); } - /** * @NoCSRFRequired * @NoAdminRequired @@ -359,7 +347,6 @@ public function testFailLoggedInCheck(){ $this->securityCheck(__FUNCTION__, 'isLoggedIn', true); } - /** * @NoCSRFRequired * @throws SecurityException @@ -369,7 +356,6 @@ public function testIsAdminCheck(){ $this->securityCheck(__FUNCTION__, 'isAdminUser'); } - /** * @NoCSRFRequired * @throws SecurityException @@ -379,7 +365,6 @@ public function testFailIsAdminCheck(){ $this->securityCheck(__FUNCTION__, 'isAdminUser', true); } - /** * @throws \Exception */ diff --git a/tests/lib/AppFramework/Middleware/SessionMiddlewareTest.php b/tests/lib/AppFramework/Middleware/SessionMiddlewareTest.php index 542aec0ba513..ec160c1f2e39 100644 --- a/tests/lib/AppFramework/Middleware/SessionMiddlewareTest.php +++ b/tests/lib/AppFramework/Middleware/SessionMiddlewareTest.php @@ -9,7 +9,6 @@ * @copyright Thomas Müller 2014 */ - namespace Test\AppFramework\Middleware; use OC\AppFramework\Http\Request; @@ -17,7 +16,6 @@ use OC\AppFramework\Utility\ControllerMethodReflector; use OCP\AppFramework\Http\Response; - class SessionMiddlewareTest extends \Test\TestCase { /** diff --git a/tests/lib/AppFramework/Routing/RoutingTest.php b/tests/lib/AppFramework/Routing/RoutingTest.php index a7a4fbb62da2..222f4cbd4b63 100644 --- a/tests/lib/AppFramework/Routing/RoutingTest.php +++ b/tests/lib/AppFramework/Routing/RoutingTest.php @@ -63,7 +63,6 @@ public function testSimpleRouteWithPostfix() $this->assertSimpleRoute($routes, 'folders.open', 'DELETE', '/folders/{folderId}/open', 'FoldersController', 'open', [], [], '_something'); } - /** * @expectedException \UnexpectedValueException */ diff --git a/tests/lib/AppFramework/Utility/ControllerMethodReflectorTest.php b/tests/lib/AppFramework/Utility/ControllerMethodReflectorTest.php index 3a943bbd5bba..779d744e0505 100644 --- a/tests/lib/AppFramework/Utility/ControllerMethodReflectorTest.php +++ b/tests/lib/AppFramework/Utility/ControllerMethodReflectorTest.php @@ -21,10 +21,8 @@ * */ - namespace Test\AppFramework\Utility; - use OC\AppFramework\Utility\ControllerMethodReflector; class BaseController { @@ -61,7 +59,6 @@ class EndController extends MiddleController {} class ControllerMethodReflectorTest extends \Test\TestCase { - /** * @Annotation */ @@ -75,7 +72,6 @@ public function testReadAnnotation(){ $this->assertTrue($reader->hasAnnotation('Annotation')); } - /** * @Annotation * @param test @@ -91,7 +87,6 @@ public function testReadAnnotationNoLowercase(){ $this->assertFalse($reader->hasAnnotation('param')); } - /** * @Annotation * @param int $test @@ -129,7 +124,6 @@ public function testReadTypeIntAnnotationsScalarTypes(){ $this->assertNull($reader->getType('d')); } - /** * @Annotation * @param double $test something special @@ -158,7 +152,6 @@ public function testReadTypeWhitespaceAnnotations(){ $this->assertEquals('string', $reader->getType('foo')); } - public function arguments($arg, $arg2='hi') {} public function testReflectParameters() { $reader = new ControllerMethodReflector(); @@ -170,7 +163,6 @@ public function testReflectParameters() { $this->assertEquals(['arg' => null, 'arg2' => 'hi'], $reader->getParameters()); } - public function arguments2($arg) {} public function testReflectParameters2() { $reader = new ControllerMethodReflector(); @@ -182,7 +174,6 @@ public function testReflectParameters2() { $this->assertEquals(['arg' => null], $reader->getParameters()); } - public function testInheritance() { $reader = new ControllerMethodReflector(); $reader->reflect('Test\AppFramework\Utility\EndController', 'test'); @@ -190,7 +181,6 @@ public function testInheritance() { $this->assertTrue($reader->hasAnnotation('Annotation')); } - public function testInheritanceOverride() { $reader = new ControllerMethodReflector(); $reader->reflect('Test\AppFramework\Utility\EndController', 'test2'); @@ -199,7 +189,6 @@ public function testInheritanceOverride() { $this->assertFalse($reader->hasAnnotation('Annotation')); } - public function testInheritanceOverrideNoDocblock() { $reader = new ControllerMethodReflector(); $reader->reflect('Test\AppFramework\Utility\EndController', 'test3'); diff --git a/tests/lib/AppFramework/Utility/SimpleContainerTest.php b/tests/lib/AppFramework/Utility/SimpleContainerTest.php index c5ec840ea4ad..a19e6eb6395f 100644 --- a/tests/lib/AppFramework/Utility/SimpleContainerTest.php +++ b/tests/lib/AppFramework/Utility/SimpleContainerTest.php @@ -24,7 +24,6 @@ use OC\AppFramework\Utility\SimpleContainer; - interface TestInterface {} class ClassEmptyConstructor implements IInterfaceConstructor {} @@ -55,7 +54,6 @@ public function __construct(IInterfaceConstructor $class, $test) { } } - class SimpleContainerTest extends \Test\TestCase { /** @var SimpleContainer */ @@ -70,7 +68,6 @@ public function testRegister() { $this->assertEquals('abc', $this->container->query('test')); } - /** * @expectedException \OCP\AppFramework\QueryException */ @@ -78,7 +75,6 @@ public function testNothingRegistered() { $this->container->query('something really hard'); } - /** * @expectedException \OCP\AppFramework\QueryException */ @@ -86,13 +82,11 @@ public function testNotAClass() { $this->container->query('Test\AppFramework\Utility\TestInterface'); } - public function testNoConstructorClass() { $object = $this->container->query('Test\AppFramework\Utility\ClassEmptyConstructor'); $this->assertInstanceOf(ClassEmptyConstructor::class, $object); } - public function testInstancesOnlyOnce() { $object = $this->container->query('Test\AppFramework\Utility\ClassEmptyConstructor'); $object2 = $this->container->query('Test\AppFramework\Utility\ClassEmptyConstructor'); @@ -108,7 +102,6 @@ public function testConstructorSimple() { $this->assertEquals('abc', $object->test); } - public function testConstructorComplex() { $this->container->registerParameter('test', 'abc'); $object = $this->container->query( @@ -119,7 +112,6 @@ public function testConstructorComplex() { $this->assertEquals('abc', $object->test); } - public function testConstructorComplexInterface() { $this->container->registerParameter('test', 'abc'); $this->container->registerService( @@ -134,7 +126,6 @@ public function testConstructorComplexInterface() { $this->assertEquals('abc', $object->test); } - public function testOverrideService() { $this->container->registerService( 'Test\AppFramework\Utility\IInterfaceConstructor', function ($c) { diff --git a/tests/lib/AppTest.php b/tests/lib/AppTest.php index 72e5b67e3ede..d236e2575710 100644 --- a/tests/lib/AppTest.php +++ b/tests/lib/AppTest.php @@ -482,7 +482,6 @@ public function testEnabledAppsCache() { $user1->delete(); } - private function setupAppConfigMock() { $appConfig = $this->createMock( '\OC\AppConfig', diff --git a/tests/lib/Archive/TARTest.php b/tests/lib/Archive/TARTest.php index 621a9ce12f47..b75d730fccef 100644 --- a/tests/lib/Archive/TARTest.php +++ b/tests/lib/Archive/TARTest.php @@ -8,7 +8,6 @@ namespace Test\Archive; - use OC\Archive\TAR; class TARTest extends TestBase { diff --git a/tests/lib/Archive/TestBase.php b/tests/lib/Archive/TestBase.php index cfaedd016ee3..8f387e9c1ee6 100644 --- a/tests/lib/Archive/TestBase.php +++ b/tests/lib/Archive/TestBase.php @@ -8,7 +8,6 @@ namespace Test\Archive; - abstract class TestBase extends \Test\TestCase { /** * @var \OC\Archive\Archive diff --git a/tests/lib/Archive/ZIPTest.php b/tests/lib/Archive/ZIPTest.php index 49beb45ab293..4863fce1ae85 100644 --- a/tests/lib/Archive/ZIPTest.php +++ b/tests/lib/Archive/ZIPTest.php @@ -8,7 +8,6 @@ namespace Test\Archive; - use OC\Archive\ZIP; class ZIPTest extends TestBase { diff --git a/tests/lib/BackgroundJob/TestJob.php b/tests/lib/BackgroundJob/TestJob.php index a5ab44545506..e15c7e86c998 100644 --- a/tests/lib/BackgroundJob/TestJob.php +++ b/tests/lib/BackgroundJob/TestJob.php @@ -8,7 +8,6 @@ namespace Test\BackgroundJob; - class TestJob extends \OC\BackgroundJob\Job { private $testCase; diff --git a/tests/lib/Command/AsyncBusTest.php b/tests/lib/Command/AsyncBusTest.php index 8c1713f12607..582d3580dd9b 100644 --- a/tests/lib/Command/AsyncBusTest.php +++ b/tests/lib/Command/AsyncBusTest.php @@ -135,7 +135,6 @@ public function testClosureSelf() { $this->assertEquals('closure-self', self::$lastCommand); } - public function testClosureThis() { // clean class to prevent phpunit putting closure in $this $test = new ThisClosureTest(); @@ -169,7 +168,6 @@ public function testFileFileAccessCommandSync() { $this->assertEquals('', self::$lastCommand); } - private function runJobs() { $jobs = $this->jobList->getAll(); foreach ($jobs as $job) { diff --git a/tests/lib/Comments/CommentTest.php b/tests/lib/Comments/CommentTest.php index d994e64c5dfc..431c4b7f68bd 100644 --- a/tests/lib/Comments/CommentTest.php +++ b/tests/lib/Comments/CommentTest.php @@ -116,6 +116,4 @@ public function testSetUberlongMessage() { $comment->setMessage($msg); } - - } diff --git a/tests/lib/ContactsManagerTest.php b/tests/lib/ContactsManagerTest.php index 466d1a0a8458..84c932715385 100644 --- a/tests/lib/ContactsManagerTest.php +++ b/tests/lib/ContactsManagerTest.php @@ -85,14 +85,12 @@ public function testSearch($search1, $search2, $expectedResult){ ->method('getKey') ->willReturn('simple:2'); - $this->cm->registerAddressBook($addressbook1); $this->cm->registerAddressBook($addressbook2); $result = $this->cm->search(''); $this->assertEquals($expectedResult, $result); } - public function testDeleteHavePermission(){ $addressbook = $this->getMockBuilder('\OCP\IAddressBook') ->disableOriginalConstructor() @@ -106,7 +104,6 @@ public function testDeleteHavePermission(){ ->method('delete') ->willReturn('returnMe'); - $this->cm->registerAddressBook($addressbook); $result = $this->cm->delete(1, $addressbook->getKey()); $this->assertEquals($result, 'returnMe'); diff --git a/tests/lib/DB/AdapterTest.php b/tests/lib/DB/AdapterTest.php index ce18b99fc5ec..f66cddcb7f03 100644 --- a/tests/lib/DB/AdapterTest.php +++ b/tests/lib/DB/AdapterTest.php @@ -166,7 +166,6 @@ public function testUpsertCatchExceptionAndThrowImmediately() { } - public function testUpsertAndThrowOtherDriverExceptions() { $mockConn = $this->createMock(IDBConnection::class); $qb = $this->createMock(IQueryBuilder::class); diff --git a/tests/lib/DB/MigrationsTest.php b/tests/lib/DB/MigrationsTest.php index fbb54bf9a1b4..257d45b7d94e 100644 --- a/tests/lib/DB/MigrationsTest.php +++ b/tests/lib/DB/MigrationsTest.php @@ -7,7 +7,6 @@ * See the COPYING-README file. */ - namespace Test\DB; use Doctrine\DBAL\Schema\Schema; diff --git a/tests/lib/DB/MigratorTest.php b/tests/lib/DB/MigratorTest.php index fe46c97cbf15..3b1ced199761 100644 --- a/tests/lib/DB/MigratorTest.php +++ b/tests/lib/DB/MigratorTest.php @@ -301,7 +301,6 @@ public function testAddingForeignKey() { $migrator = $this->manager->getMigrator(); $migrator->migrate($startSchema); - $this->assertTrue($startSchema->getTable($this->tableNameTmp)->hasForeignKey($fkName)); } } diff --git a/tests/lib/Encryption/DecryptAllTest.php b/tests/lib/Encryption/DecryptAllTest.php index f5deecaf1eda..e230ebc6b33e 100644 --- a/tests/lib/Encryption/DecryptAllTest.php +++ b/tests/lib/Encryption/DecryptAllTest.php @@ -19,10 +19,8 @@ * */ - namespace Test\Encryption; - use OC\Encryption\DecryptAll; use OC\Encryption\Exceptions\DecryptionFailedException; use OC\Encryption\Manager; @@ -139,7 +137,6 @@ public function testDecryptAll($prepareResult, $user, $userExistsChecked) { ->setMethods(['prepareEncryptionModules', 'decryptAllUsersFiles']) ->getMock(); - \OC::$server->getAppConfig()->setValue('encryption', 'useMasterKey', '1'); $instance->expects($this->once()) @@ -230,7 +227,6 @@ public function testNoUsersSeen() { $this->invokePrivate($instance, 'input', [$this->inputInterface]); $this->invokePrivate($instance, 'output', [$this->outputInterface]); - $function = function (IUser $user) { $users[] = $user->getUID(); }; @@ -264,7 +260,6 @@ public function testDecryptAllUsersFiles($user) { $this->invokePrivate($instance, 'input', [$this->inputInterface]); $this->invokePrivate($instance, 'output', [$this->outputInterface]); - $function = function (IUser $user) { $users[] = $user->getUID(); }; diff --git a/tests/lib/Encryption/EncryptionWrapperTest.php b/tests/lib/Encryption/EncryptionWrapperTest.php index 7687631cdf00..8bc4a45cf207 100644 --- a/tests/lib/Encryption/EncryptionWrapperTest.php +++ b/tests/lib/Encryption/EncryptionWrapperTest.php @@ -19,10 +19,8 @@ * */ - namespace Test\Encryption; - use OC\Encryption\EncryptionWrapper; use Test\TestCase; @@ -51,7 +49,6 @@ public function setUp() { $this->instance = new EncryptionWrapper($this->arrayCache, $this->manager, $this->logger); } - /** * @dataProvider provideWrapStorage */ diff --git a/tests/lib/Encryption/UpdateTest.php b/tests/lib/Encryption/UpdateTest.php index b5b68905998b..e20aa74868ef 100644 --- a/tests/lib/Encryption/UpdateTest.php +++ b/tests/lib/Encryption/UpdateTest.php @@ -19,10 +19,8 @@ * */ - namespace Test\Encryption; - use OC\Encryption\Update; use Test\TestCase; @@ -177,7 +175,6 @@ public function dataTestPostRename() { ]; } - /** * @dataProvider dataTestPostRestore * diff --git a/tests/lib/Files/Cache/CacheTest.php b/tests/lib/Files/Cache/CacheTest.php index 7717035bb261..1cf5cd5eb0a6 100644 --- a/tests/lib/Files/Cache/CacheTest.php +++ b/tests/lib/Files/Cache/CacheTest.php @@ -8,7 +8,6 @@ namespace Test\Files\Cache; - use OC\Files\Cache\Cache; use OC\Files\Storage\Temporary; use Test\TestCase; diff --git a/tests/lib/Files/External/Service/DBConfigServiceTest.php b/tests/lib/Files/External/Service/DBConfigServiceTest.php index 9ac7418a99f7..a994126523be 100644 --- a/tests/lib/Files/External/Service/DBConfigServiceTest.php +++ b/tests/lib/Files/External/Service/DBConfigServiceTest.php @@ -22,7 +22,6 @@ namespace Test\Files\External\Service; - use OC\Files\External\Service\DBConfigService; use OCP\IDBConnection; use Test\TestCase; diff --git a/tests/lib/Files/External/Service/GlobalStoragesServiceTest.php b/tests/lib/Files/External/Service/GlobalStoragesServiceTest.php index 83bf28cfab2b..c8a4c8f31ebe 100644 --- a/tests/lib/Files/External/Service/GlobalStoragesServiceTest.php +++ b/tests/lib/Files/External/Service/GlobalStoragesServiceTest.php @@ -136,7 +136,6 @@ private function assertEqualsArrays($expected, $actual) { $this->assertEquals($expected, $actual); } - /** * @dataProvider storageDataProvider */ diff --git a/tests/lib/Files/External/Service/StoragesServiceTest.php b/tests/lib/Files/External/Service/StoragesServiceTest.php index 630420978946..6de0c7265338 100644 --- a/tests/lib/Files/External/Service/StoragesServiceTest.php +++ b/tests/lib/Files/External/Service/StoragesServiceTest.php @@ -232,7 +232,6 @@ protected function makeStorageConfig($data) { return $storage; } - /** * @expectedException \OCP\Files\External\NotFoundException */ diff --git a/tests/lib/Files/MetaFilesTest.php b/tests/lib/Files/MetaFilesTest.php index f949f699f547..75aa259c6615 100644 --- a/tests/lib/Files/MetaFilesTest.php +++ b/tests/lib/Files/MetaFilesTest.php @@ -19,10 +19,8 @@ * */ - namespace Test\Files; - use OC\Files\Meta\MetaFileIdNode; use OC\Files\Meta\MetaFileVersionNode; use OC\Files\Meta\MetaRootNode; diff --git a/tests/lib/Files/Mount/MountTest.php b/tests/lib/Files/Mount/MountTest.php index 160545e784cd..340e6931c1d8 100644 --- a/tests/lib/Files/Mount/MountTest.php +++ b/tests/lib/Files/Mount/MountTest.php @@ -8,7 +8,6 @@ namespace Test\Files\Mount; - use OC\Files\Storage\StorageFactory; use OC\Files\Storage\Wrapper\Wrapper; diff --git a/tests/lib/Files/Node/AbstractFileTest.php b/tests/lib/Files/Node/AbstractFileTest.php index a242be749433..31aca8106e52 100644 --- a/tests/lib/Files/Node/AbstractFileTest.php +++ b/tests/lib/Files/Node/AbstractFileTest.php @@ -19,10 +19,8 @@ * */ - namespace Test\Files\Node; - use OC\Files\Node\AbstractFile; use OCP\Files\FileInfo; use Test\TestCase; diff --git a/tests/lib/Files/Node/AbstractFolderTest.php b/tests/lib/Files/Node/AbstractFolderTest.php index d74620f2cd20..6a64f2df3729 100644 --- a/tests/lib/Files/Node/AbstractFolderTest.php +++ b/tests/lib/Files/Node/AbstractFolderTest.php @@ -19,10 +19,8 @@ * */ - namespace Test\Files\Node; - use OC\Files\Node\AbstractFolder; use OCP\Files\FileInfo; use Test\TestCase; diff --git a/tests/lib/Files/Node/AbstractNodeTest.php b/tests/lib/Files/Node/AbstractNodeTest.php index 17080a9de70d..0f11ef704a9f 100644 --- a/tests/lib/Files/Node/AbstractNodeTest.php +++ b/tests/lib/Files/Node/AbstractNodeTest.php @@ -19,10 +19,8 @@ * */ - namespace Test\Files\Node; - use OC\Files\Node\AbstractNode; use Test\TestCase; diff --git a/tests/lib/Files/Node/FolderTest.php b/tests/lib/Files/Node/FolderTest.php index 19a1c312e11a..d10121dd28e2 100644 --- a/tests/lib/Files/Node/FolderTest.php +++ b/tests/lib/Files/Node/FolderTest.php @@ -535,7 +535,6 @@ public function testSearchSubStorages() { ->with('/bar/foo') ->will($this->returnValue($mount)); - $node = new Folder($root, $view, '/bar/foo'); $result = $node->search('qw'); $this->assertCount(2, $result); diff --git a/tests/lib/Files/Node/IntegrationTest.php b/tests/lib/Files/Node/IntegrationTest.php index 8d3f384bd5fd..da73e96ffe72 100644 --- a/tests/lib/Files/Node/IntegrationTest.php +++ b/tests/lib/Files/Node/IntegrationTest.php @@ -104,7 +104,6 @@ public function testBasicFolder() { $this->assertEquals($file->getId(), $listing[0]->getId()); $this->assertEquals($file->getStorage(), $listing[0]->getStorage()); - $rootListing = $this->root->getDirectoryListing(); $this->assertCount(3, $rootListing); diff --git a/tests/lib/Files/Node/NodeTest.php b/tests/lib/Files/Node/NodeTest.php index 8a6f175ca183..1def302b0bde 100644 --- a/tests/lib/Files/Node/NodeTest.php +++ b/tests/lib/Files/Node/NodeTest.php @@ -151,7 +151,6 @@ public function testDeleteNotPermitted() { $node->delete(); } - public function testStat() { /** * @var \OC\Files\View | \PHPUnit_Framework_MockObject_MockObject $view @@ -215,7 +214,6 @@ public function testGetSize() { ->method('getUser') ->will($this->returnValue($this->user)); - $stat = $this->getFileInfo([ 'fileid' => 1, 'size' => 100, @@ -303,7 +301,6 @@ public function testGetStorage() { ->with('/bar/foo') ->will($this->returnValue([$storage, 'foo'])); - $node = $this->createTestNode($root, $view, '/bar/foo'); $this->assertEquals($storage, $node->getStorage()); } @@ -341,7 +338,6 @@ public function testGetInternalPath() { ->with('/bar/foo') ->will($this->returnValue([$storage, 'foo'])); - $node = $this->createTestNode($root, $view, '/bar/foo'); $this->assertEquals('foo', $node->getInternalPath()); } diff --git a/tests/lib/Files/ObjectStore/MapperTest.php b/tests/lib/Files/ObjectStore/MapperTest.php index 47c181ac8585..baa695366b62 100644 --- a/tests/lib/Files/ObjectStore/MapperTest.php +++ b/tests/lib/Files/ObjectStore/MapperTest.php @@ -20,7 +20,6 @@ */ namespace Test\Files\ObjectStore; - use OC\Files\ObjectStore\Mapper; class MapperTest extends \Test\TestCase { diff --git a/tests/lib/Files/ObjectStore/ObjectStoreStorageTest.php b/tests/lib/Files/ObjectStore/ObjectStoreStorageTest.php index d156dc293bf3..25fbfe9e9450 100644 --- a/tests/lib/Files/ObjectStore/ObjectStoreStorageTest.php +++ b/tests/lib/Files/ObjectStore/ObjectStoreStorageTest.php @@ -21,7 +21,6 @@ namespace Test\Files\ObjectStore; - /** * Class ObjectStoreStorageTest * diff --git a/tests/lib/Files/PathVerificationTest.php b/tests/lib/Files/PathVerificationTest.php index abbf7f45ad3b..ae67f180eff9 100644 --- a/tests/lib/Files/PathVerificationTest.php +++ b/tests/lib/Files/PathVerificationTest.php @@ -39,7 +39,6 @@ public function testPathVerificationFileNameTooLong() { $this->view->verifyPath('', $fileName); } - /** * @dataProvider providesEmptyFiles * @expectedException \OCP\Files\InvalidPathException diff --git a/tests/lib/Files/Storage/Storage.php b/tests/lib/Files/Storage/Storage.php index 6d33bfa7b599..0ca01f8fa614 100644 --- a/tests/lib/Files/Storage/Storage.php +++ b/tests/lib/Files/Storage/Storage.php @@ -175,7 +175,6 @@ public function testMimeType() { $this->assertEquals('image/svg+xml', $this->instance->getMimeType('/desktopapp.svg')); } - public function copyAndMoveProvider() { return [ ['/source.txt', '/target.txt'], diff --git a/tests/lib/Files/Storage/Wrapper/ChecksumTest.php b/tests/lib/Files/Storage/Wrapper/ChecksumTest.php index 70b05204a829..2d68aa2f5f6e 100644 --- a/tests/lib/Files/Storage/Wrapper/ChecksumTest.php +++ b/tests/lib/Files/Storage/Wrapper/ChecksumTest.php @@ -21,7 +21,6 @@ namespace Test\Files\Storage\Wrapper; - use OC\Files\Storage\Wrapper\Checksum; /** @@ -49,7 +48,6 @@ public function setUp() { ]); } - public function testFilePutContentsCalculatesChecksum() { $this->instance->file_put_contents('/foo.txt', 'somedata'); $metaData = $this->instance->getMetaData('/foo.txt'); @@ -67,13 +65,10 @@ public function testWriteToFileHandleCalculatesChecksum() { $metaData = $this->instance->getMetaData('/foo.txt'); - $this->assertArrayHasKey('checksum', $metaData); $this->assertEquals(self::EXPECTED_CHECKSUMS, $metaData['checksum']); } - - public function testReadFromFileHandleOnNewFileCalculatesChecksum() { $this->sourceStorage->file_put_contents('/foo.txt', self::TEST_DATA); diff --git a/tests/lib/Files/Storage/Wrapper/DirMaskTest.php b/tests/lib/Files/Storage/Wrapper/DirMaskTest.php index 75e495c51f68..00094db37cb9 100644 --- a/tests/lib/Files/Storage/Wrapper/DirMaskTest.php +++ b/tests/lib/Files/Storage/Wrapper/DirMaskTest.php @@ -3,13 +3,11 @@ namespace Test\Files\Storage\Wrapper; - use OC\Files\Storage\Temporary; use OC\Files\Storage\Wrapper\DirMask; use OCP\Constants; use PHPUnit\Framework\TestCase; - class DirMaskTest extends TestCase { /** @var Temporary */ @@ -50,7 +48,6 @@ public function testIsUpdatable() { ); } - public function testIsDeletable() { $readOnlyStorage = $this->getStorage(Constants::PERMISSION_READ); $this->assertFalse( @@ -75,7 +72,6 @@ public function testIsSharable() { ); } - public function testMkdir() { $storage = $this->getStorage(Constants::PERMISSION_CREATE); $this->assertTrue($storage->mkdir('masked/dir2')); diff --git a/tests/lib/Files/Storage/Wrapper/EncryptionTest.php b/tests/lib/Files/Storage/Wrapper/EncryptionTest.php index 278769266e70..fa2071ebc898 100644 --- a/tests/lib/Files/Storage/Wrapper/EncryptionTest.php +++ b/tests/lib/Files/Storage/Wrapper/EncryptionTest.php @@ -67,7 +67,6 @@ class EncryptionTest extends Storage { */ private $file; - /** * @var \OC\Files\Mount\MountPoint | \PHPUnit_Framework_MockObject_MockObject */ @@ -91,7 +90,6 @@ class EncryptionTest extends Storage { /** @var \OC\Memcache\ArrayCache | \PHPUnit_Framework_MockObject_MockObject */ private $arrayCache; - /** @var integer dummy unencrypted size */ private $dummySize = -1; @@ -326,7 +324,6 @@ public function testFilesize() { $this->instance->expects($this->any())->method('verifyUnencryptedSize') ->willReturn(42); - $this->assertSame(42, $this->instance->filesize('/test.txt') ); @@ -479,7 +476,6 @@ public function testRmdir($path, $rmdirResult, $isExcluded, $encryptionEnabled) $this->encryptionManager, $util, $this->logger, $this->file, null, $this->keyStore, $this->update ); - if ($rmdirResult === true && $isExcluded === false && $encryptionEnabled === true) { $this->keyStore->expects($this->once())->method('deleteAllFileKeys')->with('/mountPoint' . $path); } else { diff --git a/tests/lib/Files/Storage/Wrapper/ReadOnlyJailTest.php b/tests/lib/Files/Storage/Wrapper/ReadOnlyJailTest.php index 77fba5f53d2a..686c3d135d0a 100644 --- a/tests/lib/Files/Storage/Wrapper/ReadOnlyJailTest.php +++ b/tests/lib/Files/Storage/Wrapper/ReadOnlyJailTest.php @@ -2,13 +2,11 @@ namespace Test\Files\Storage\Wrapper; - use OC\Files\Storage\Temporary; use OC\Files\Storage\Wrapper\ReadOnlyJail; use OCP\Constants; use PHPUnit\Framework\TestCase; - class ReadOnlyJailTest extends TestCase { /** @var ReadOnlyJail */ diff --git a/tests/lib/Files/Stream/DummyEncryptionWrapper.php b/tests/lib/Files/Stream/DummyEncryptionWrapper.php index a025bcf6305a..225f8d513f39 100644 --- a/tests/lib/Files/Stream/DummyEncryptionWrapper.php +++ b/tests/lib/Files/Stream/DummyEncryptionWrapper.php @@ -19,7 +19,6 @@ * */ - namespace Test\Files\Stream; class DummyEncryptionWrapper extends \OC\Files\Stream\Encryption { diff --git a/tests/lib/Files/Stream/EncryptionTest.php b/tests/lib/Files/Stream/EncryptionTest.php index d73dbd9ae27d..6897b121222b 100644 --- a/tests/lib/Files/Stream/EncryptionTest.php +++ b/tests/lib/Files/Stream/EncryptionTest.php @@ -52,7 +52,6 @@ protected function getStream($fileName, $mode, $unencryptedSize, $wrapper = '\OC ->method('getUidAndFilename') ->willReturn(['user1', $internalPath]); - return $wrapper::wrap($source, $internalPath, $fullPath, $header, $uid, $this->encryptionModule, $storage, $encStorage, $util, $file, $mode, $size, $unencryptedSize, 8192, $wrapper); diff --git a/tests/lib/Files/Type/DetectionTest.php b/tests/lib/Files/Type/DetectionTest.php index c04a1b68b2a0..f0fbeea375e6 100644 --- a/tests/lib/Files/Type/DetectionTest.php +++ b/tests/lib/Files/Type/DetectionTest.php @@ -110,7 +110,6 @@ public function testMimeTypeIcon() { $mimeType = $detection->mimeTypeIcon('dir'); $this->assertEquals('folder.svg', $mimeType); - /* * Test dir-shareed mimetype */ @@ -129,7 +128,6 @@ public function testMimeTypeIcon() { $mimeType = $detection->mimeTypeIcon('dir-shared'); $this->assertEquals('folder-shared.svg', $mimeType); - /* * Test dir external */ @@ -149,7 +147,6 @@ public function testMimeTypeIcon() { $mimeType = $detection->mimeTypeIcon('dir-external'); $this->assertEquals('folder-external.svg', $mimeType); - /* * Test complete mimetype */ @@ -169,7 +166,6 @@ public function testMimeTypeIcon() { $mimeType = $detection->mimeTypeIcon('my-type'); $this->assertEquals('my-type.svg', $mimeType); - /* * Test subtype */ @@ -199,7 +195,6 @@ function($appName, $file) { $mimeType = $detection->mimeTypeIcon('my-type'); $this->assertEquals('my.svg', $mimeType); - /* * Test default mimetype */ @@ -251,8 +246,6 @@ function($appName, $file) { $mimeType = $detection->mimeTypeIcon('foo-bar'); $this->assertEquals('foo-bar.svg', $mimeType); - - /* * Test aliases */ diff --git a/tests/lib/Files/Type/LoaderTest.php b/tests/lib/Files/Type/LoaderTest.php index bd66bdeeb118..9d8f1bb9fbba 100644 --- a/tests/lib/Files/Type/LoaderTest.php +++ b/tests/lib/Files/Type/LoaderTest.php @@ -44,7 +44,6 @@ protected function tearDown() { $deleteMimetypes->execute(); } - public function testGetMimetype() { $qb = $this->db->getQueryBuilder(); $qb->insert('mimetypes') diff --git a/tests/lib/Files/ViewTest.php b/tests/lib/Files/ViewTest.php index 47c3d87e8905..89e154c70ed7 100644 --- a/tests/lib/Files/ViewTest.php +++ b/tests/lib/Files/ViewTest.php @@ -2070,7 +2070,6 @@ public function testLockBasicOperationUnlocksAfterException( return $path === 'files/test.txt'; }); - $storage->getScanner()->scan('files'); $this->shallThrow = true; @@ -2512,7 +2511,6 @@ private function getFileLockType(View $view, $path, $onMountPoint = false) { return null; } - public function testRemoveMoveableMountPoint() { $mountPoint = '/' . $this->user . '/files/mount/'; diff --git a/tests/lib/Group/ManagerTest.php b/tests/lib/Group/ManagerTest.php index b51b129413c8..e0737328b4d2 100644 --- a/tests/lib/Group/ManagerTest.php +++ b/tests/lib/Group/ManagerTest.php @@ -817,7 +817,6 @@ public function testDisplayNamesInGroupWithOneUserBackendWithLimitSpecified() { } })); - $this->userManager->expects($this->any()) ->method('searchDisplayName') ->with('user3') @@ -1008,7 +1007,6 @@ public function testDisplayNamesInGroupWithOneUserBackendAndSearchEmptyAndLimitA ->with('testgroup', '', 1, 1) ->will($this->returnValue(['user33'])); - $this->userManager->expects($this->any()) ->method('get') ->will($this->returnCallback(function($uid) { @@ -1431,7 +1429,6 @@ public function testFindUsersInGroupWithOneUserBackendAndSearchEmptyAndLimitAndO ->with('testgroup', '', 1, 1) ->will($this->returnValue(['user33'])); - $this->userManager->expects($this->any()) ->method('get') ->will($this->returnCallback(function($uid) { diff --git a/tests/lib/HTTPHelperTest.php b/tests/lib/HTTPHelperTest.php index 179caa29708b..73d2cda6f8ef 100644 --- a/tests/lib/HTTPHelperTest.php +++ b/tests/lib/HTTPHelperTest.php @@ -77,7 +77,6 @@ public function testPostSuccess() { ->method('getBody') ->will($this->returnValue('Body of the requested page')); - $response = $this->httpHelperMock->post('https://owncloud.org', ['Foo' => 'Bar']); $expected = [ 'success' => true, @@ -108,7 +107,6 @@ public function testPostException() { ) ->will($this->throwException(new \Exception('Something failed'))); - $response = $this->httpHelperMock->post('https://owncloud.org', ['Foo' => 'Bar']); $expected = [ 'success' => false, diff --git a/tests/lib/HelperStorageTest.php b/tests/lib/HelperStorageTest.php index f8c0d0570ca2..04df1ee5c323 100644 --- a/tests/lib/HelperStorageTest.php +++ b/tests/lib/HelperStorageTest.php @@ -167,7 +167,6 @@ function testGetStorageInfoIncludingExtStorageWithNoUserQuota() { $config->setSystemValue('quota_include_external_storage', $oldConfig); } - /** * Test getting the storage info with quota enabled */ diff --git a/tests/lib/InstallerTest.php b/tests/lib/InstallerTest.php index 350aef7f9443..1929f29b1f87 100644 --- a/tests/lib/InstallerTest.php +++ b/tests/lib/InstallerTest.php @@ -8,7 +8,6 @@ namespace Test; - use OC\Installer; class InstallerTest extends TestCase { diff --git a/tests/lib/IntegrityCheck/CheckerTest.php b/tests/lib/IntegrityCheck/CheckerTest.php index e79e6f0a019f..db8521e0544c 100644 --- a/tests/lib/IntegrityCheck/CheckerTest.php +++ b/tests/lib/IntegrityCheck/CheckerTest.php @@ -156,7 +156,6 @@ public function testIgnoredAppSignatureWithoutSignatureData() { $this->assertSame($expected, $this->checker->verifyAppSignature('SomeApp')); } - public function testVerifyAppSignatureWithoutSignatureData() { $this->environmentHelper ->expects($this->once()) @@ -313,7 +312,6 @@ public function testVerifyAppSignatureWithTamperedFiles() { ) ->will($this->returnValue(\file_get_contents(__DIR__ .'/../../data/integritycheck/root.crt'))); - $expected = [ 'INVALID_HASH' => [ 'AnotherFile.txt' => [ @@ -378,7 +376,6 @@ public function testVerifyAppSignatureWithTamperedFilesAndAlternatePath() { ) ->will($this->returnValue(\file_get_contents(__DIR__ .'/../../data/integritycheck/root.crt'))); - $expected = [ 'INVALID_HASH' => [ 'AnotherFile.txt' => [ diff --git a/tests/lib/IntegrityCheck/Iterator/ExcludeFileByNameFilterIteratorTest.php b/tests/lib/IntegrityCheck/Iterator/ExcludeFileByNameFilterIteratorTest.php index e944b3f92dab..ccb101263abb 100644 --- a/tests/lib/IntegrityCheck/Iterator/ExcludeFileByNameFilterIteratorTest.php +++ b/tests/lib/IntegrityCheck/Iterator/ExcludeFileByNameFilterIteratorTest.php @@ -84,7 +84,6 @@ public function testAcceptForFiles($path, $fileName, $expectedResult){ $this->assertEquals($expectedResult, $actualResult); } - /** * @dataProvider fileNameProvider * @param string $fileName diff --git a/tests/lib/L10N/FactoryTest.php b/tests/lib/L10N/FactoryTest.php index f95cc3c5e31d..0304bcfca9e4 100644 --- a/tests/lib/L10N/FactoryTest.php +++ b/tests/lib/L10N/FactoryTest.php @@ -271,7 +271,6 @@ public function testFindLanguageWithNotExistingRequestLanguageAndNotExistingStor ->method('setUserValue') ->with('MyUserUid', 'core', 'lang', 'en'); - $this->assertSame('en', $factory->findLanguage('MyApp')); } diff --git a/tests/lib/L10N/L10nTest.php b/tests/lib/L10N/L10nTest.php index 7ade46de7dbe..13b559def4e7 100644 --- a/tests/lib/L10N/L10nTest.php +++ b/tests/lib/L10N/L10nTest.php @@ -8,7 +8,6 @@ namespace Test\L10N; - use DateTime; use OC\L10N\Factory; use OC\L10N\L10N; diff --git a/tests/lib/LegacyHelperTest.php b/tests/lib/LegacyHelperTest.php index 5b37ca86ab1f..dcbc7a8b505b 100644 --- a/tests/lib/LegacyHelperTest.php +++ b/tests/lib/LegacyHelperTest.php @@ -213,7 +213,6 @@ public function testStreamCopy($expectedCount, $expectedResult, $source, $target $this->assertSame($expectedResult, $result); } - function streamCopyDataProvider() { return [ [0, false, false, false], diff --git a/tests/lib/Lock/LockingProvider.php b/tests/lib/Lock/LockingProvider.php index cfcc3b5a75e0..a2ddeb332f88 100644 --- a/tests/lib/Lock/LockingProvider.php +++ b/tests/lib/Lock/LockingProvider.php @@ -163,7 +163,6 @@ public function testReleaseAfterReleaseAll() { $this->instance->releaseLock('foo', ILockingProvider::LOCK_SHARED); } - /** * @expectedException \OCP\Lock\LockedException */ diff --git a/tests/lib/Log/OwncloudTest.php b/tests/lib/Log/OwncloudTest.php index 40a817672d56..9035fba59ca7 100644 --- a/tests/lib/Log/OwncloudTest.php +++ b/tests/lib/Log/OwncloudTest.php @@ -76,5 +76,4 @@ public function testMicrosecondsLogTimestamp() { } - } diff --git a/tests/lib/Memcache/Cache.php b/tests/lib/Memcache/Cache.php index 8d6a231dd8d6..a89f855bd548 100644 --- a/tests/lib/Memcache/Cache.php +++ b/tests/lib/Memcache/Cache.php @@ -122,7 +122,6 @@ public function testCadChanged() { $this->assertTrue($this->instance->hasKey('foo')); } - protected function tearDown() { if ($this->instance) { $this->instance->clear(); diff --git a/tests/lib/Migration/BackgroundRepairTest.php b/tests/lib/Migration/BackgroundRepairTest.php index ce179641915e..435af3c6da57 100644 --- a/tests/lib/Migration/BackgroundRepairTest.php +++ b/tests/lib/Migration/BackgroundRepairTest.php @@ -21,7 +21,6 @@ namespace Test\Migration; - use OC\Migration\BackgroundRepair; use OC\NeedsUpdateException; use OCP\ILogger; diff --git a/tests/lib/Notification/ActionTest.php b/tests/lib/Notification/ActionTest.php index ebec00849258..faaffc38dcaa 100644 --- a/tests/lib/Notification/ActionTest.php +++ b/tests/lib/Notification/ActionTest.php @@ -21,7 +21,6 @@ namespace Test\Notification; - use OC\Notification\Action; use OCP\Notification\IAction; use Test\TestCase; diff --git a/tests/lib/Notification/NotificationTest.php b/tests/lib/Notification/NotificationTest.php index 8c06f5638dcb..297333db50b1 100644 --- a/tests/lib/Notification/NotificationTest.php +++ b/tests/lib/Notification/NotificationTest.php @@ -21,7 +21,6 @@ namespace Test\Notification; - use OC\Notification\Notification; use OCP\Notification\INotification; use Test\TestCase; diff --git a/tests/lib/PublicNamespace/UtilTest.php b/tests/lib/PublicNamespace/UtilTest.php index e9ec5f884c7c..6153c08990e1 100644 --- a/tests/lib/PublicNamespace/UtilTest.php +++ b/tests/lib/PublicNamespace/UtilTest.php @@ -21,7 +21,6 @@ namespace Test\PublicNamespace; - class UtilTest extends \Test\TestCase { protected function setUp() { parent::setUp(); diff --git a/tests/lib/Repair/CleanTagsTest.php b/tests/lib/Repair/CleanTagsTest.php index 15dd0b0f929e..bfba40e96c8f 100644 --- a/tests/lib/Repair/CleanTagsTest.php +++ b/tests/lib/Repair/CleanTagsTest.php @@ -94,7 +94,6 @@ public function testRun() { $this->assertEntryCount('vcategory_to_object', 2, 'Assert tag entries count after cleaning category entries'); $this->assertEntryCount('vcategory', 2, 'Assert tag categories count after cleaning category entries'); - $this->addTagCategory('TestRepairCleanTags', 'contacts', 'userExists'); // Retained $this->assertEntryCount('vcategory', 3, 'Assert tag categories count before cleaning categories by users'); diff --git a/tests/lib/Repair/RepairInvalidSharesTest.php b/tests/lib/Repair/RepairInvalidSharesTest.php index c6d25b53de9e..2680396b664b 100644 --- a/tests/lib/Repair/RepairInvalidSharesTest.php +++ b/tests/lib/Repair/RepairInvalidSharesTest.php @@ -8,7 +8,6 @@ namespace Test\Repair; - use OC\Repair\RepairInvalidShares; use OC\Share\Constants; use OCP\Migration\IOutput; diff --git a/tests/lib/Repair/RepairMismatchFileCachePathTest.php b/tests/lib/Repair/RepairMismatchFileCachePathTest.php index 2cd2f1f0579f..7ecba4dea5d7 100644 --- a/tests/lib/Repair/RepairMismatchFileCachePathTest.php +++ b/tests/lib/Repair/RepairMismatchFileCachePathTest.php @@ -347,7 +347,6 @@ public function testRepairSelfReferencing() { $untouchedFolderId_parallel = $this->createFileCacheEntry($storageId2, 'files/untouched_folder', $baseId2); // End parallel storage - $outputMock = $this->createMock(IOutput::class); $this->repair->setStorageNumericId($storageId); $this->repair->run($outputMock); @@ -520,7 +519,6 @@ public function testRepairSelfReferencing() { // end testing parallel storage } - /** * Test repair wrong parent id */ @@ -702,7 +700,6 @@ public function testRepairMissingRoot() { $baseId = $this->createFileCacheEntry($testStorageId, ''); $noRootid = $this->createFileCacheEntry($testStorageId, 'noroot', $baseId); - $outputMock = $this->createMock(IOutput::class); $this->repair->setStorageNumericId($storageId); $this->repair->run($outputMock); diff --git a/tests/lib/Repair/RepairOrphanedSubshareTest.php b/tests/lib/Repair/RepairOrphanedSubshareTest.php index d016113b0580..b19a6a0adc3b 100644 --- a/tests/lib/Repair/RepairOrphanedSubshareTest.php +++ b/tests/lib/Repair/RepairOrphanedSubshareTest.php @@ -19,7 +19,6 @@ * */ - namespace Test\Repair; use OC\Repair\RepairOrphanedSubshare; diff --git a/tests/lib/Repair/RepairUnmergedSharesTest.php b/tests/lib/Repair/RepairUnmergedSharesTest.php index e84d2b550752..47b1e8283b61 100644 --- a/tests/lib/Repair/RepairUnmergedSharesTest.php +++ b/tests/lib/Repair/RepairUnmergedSharesTest.php @@ -21,7 +21,6 @@ namespace Test\Repair; - use OC\Repair\RepairUnmergedShares; use OC\Share\Constants; use OC\Share20\DefaultShareProvider; diff --git a/tests/lib/Route/RouteTest.php b/tests/lib/Route/RouteTest.php index 091e758c9167..5be83edcd660 100644 --- a/tests/lib/Route/RouteTest.php +++ b/tests/lib/Route/RouteTest.php @@ -19,7 +19,6 @@ * */ - namespace Test\Route; use OC\Route\Route; diff --git a/tests/lib/Route/RouterTest.php b/tests/lib/Route/RouterTest.php index 4243b876f7ab..1cc082f08272 100644 --- a/tests/lib/Route/RouterTest.php +++ b/tests/lib/Route/RouterTest.php @@ -21,7 +21,6 @@ namespace Test\Route; - use OC\Route\Router; use OCP\ILogger; diff --git a/tests/lib/Security/CSP/ContentSecurityPolicyManagerTest.php b/tests/lib/Security/CSP/ContentSecurityPolicyManagerTest.php index 854175bc1c0b..195046927838 100644 --- a/tests/lib/Security/CSP/ContentSecurityPolicyManagerTest.php +++ b/tests/lib/Security/CSP/ContentSecurityPolicyManagerTest.php @@ -21,7 +21,6 @@ namespace Test\Security\CSP; - use OC\Security\CSP\ContentSecurityPolicy; use OC\Security\CSP\ContentSecurityPolicyManager; use OCP\AppFramework\Http\EmptyContentSecurityPolicy; diff --git a/tests/lib/Security/HasherTest.php b/tests/lib/Security/HasherTest.php index 2790b1cb8b34..79f4be1e357b 100644 --- a/tests/lib/Security/HasherTest.php +++ b/tests/lib/Security/HasherTest.php @@ -100,7 +100,6 @@ function testSplitHash($hash, $expected) { $this->assertSame($expected, $relativePath); } - /** * @dataProvider allHashProviders */ diff --git a/tests/lib/ServerTest.php b/tests/lib/ServerTest.php index 24b7db2a1ed6..66ea8c603c45 100644 --- a/tests/lib/ServerTest.php +++ b/tests/lib/ServerTest.php @@ -39,7 +39,6 @@ class ServerTest extends \Test\TestCase { /** @var Server */ protected $server; - public function setUp() { parent::setUp(); $config = new Config(\OC::$configDir); diff --git a/tests/lib/Share/Backend.php b/tests/lib/Share/Backend.php index f9c8392e9f8e..8c32037b1666 100644 --- a/tests/lib/Share/Backend.php +++ b/tests/lib/Share/Backend.php @@ -46,7 +46,6 @@ public function generateTarget($itemSource, $shareWith, $exclude = null) { $target = $itemSource; } - $shares = \OCP\Share::getItemsSharedWithUser('test', $shareWith); $knownTargets = []; @@ -54,7 +53,6 @@ public function generateTarget($itemSource, $shareWith, $exclude = null) { $knownTargets[] = $share['item_target']; } - if (\in_array($target, $knownTargets)) { $pos = \strrpos($target, '.'); $name = \substr($target, 0, $pos); diff --git a/tests/lib/Share/MailNotificationsTest.php b/tests/lib/Share/MailNotificationsTest.php index 0b62560e0408..ff13c998ec22 100644 --- a/tests/lib/Share/MailNotificationsTest.php +++ b/tests/lib/Share/MailNotificationsTest.php @@ -48,7 +48,6 @@ class MailNotificationsTest extends TestCase { /** @var IURLGenerator | \PHPUnit_Framework_MockObject_MockObject */ private $urlGenerator; - public function setUp() { parent::setUp(); diff --git a/tests/lib/Share/ShareTest.php b/tests/lib/Share/ShareTest.php index 96bc64bf448e..93e203f1fd6d 100644 --- a/tests/lib/Share/ShareTest.php +++ b/tests/lib/Share/ShareTest.php @@ -439,7 +439,6 @@ public function testShareWithUserExpirationValid() { $this->shareUserOneTestFileWithUserTwo(); $this->shareUserTestFileAsLink(); - $this->assertTrue( \OCP\Share::setExpirationDate('test', 'test.txt', $this->dateInFuture, ''), 'Failed asserting that user 1 successfully set an expiration date for the test.txt share.' @@ -622,7 +621,6 @@ public function testGetItemSharedWithUser() { $args = ['test', 99, 'target4', \OCP\Share::SHARE_TYPE_USER, $this->user6, $this->user4]; $query->execute($args); - $result1 = \OCP\Share::getItemSharedWithUser('test', 99, $this->user2, $this->user1); $this->assertCount(1, $result1); $this->verifyResult($result1, ['target1']); @@ -967,7 +965,6 @@ public function testRemoteShareUrlCalls($shareWith, $urlHost, $allowFallback, $h $this->expectException($expectedException); } - $oldFallbackValue = \OC::$server->getConfig()->getSystemValue('sharing.federation.allowHttpFallback'); \OC::$server->getConfig()->setSystemValue('sharing.federation.allowHttpFallback', $allowFallback); @@ -1007,7 +1004,6 @@ public function testRemoteShareUrlCalls($shareWith, $urlHost, $allowFallback, $h ->willReturn(['success' => false, 'result' => 'Exception']); } - if($allowFallback && !$httpsSuccess) { $httpHelperMock->expects($this->at(1)) ->method('post') @@ -1215,7 +1211,6 @@ public function testSetPassword() { ->getMock(); $userSession->method('getUser')->willReturn($user); - $ex = $this->getMockBuilder('\OC\DB\QueryBuilder\ExpressionBuilder\ExpressionBuilder') ->disableOriginalConstructor() ->getMock(); @@ -1237,7 +1232,6 @@ public function testSetPassword() { $ret->method('fetch')->willReturn(['uid_owner' => 'user']); $qb->method('execute')->willReturn($ret); - $connection = $this->getMockBuilder('\OC\DB\Connection') ->disableOriginalConstructor() ->getMock(); @@ -1247,7 +1241,6 @@ public function testSetPassword() { ->disableOriginalConstructor() ->getMock(); - $res = \OC\Share\Share::setPassword($userSession, $connection, $config, 1, 'pass'); $this->assertTrue($res); @@ -1270,7 +1263,6 @@ public function testSetPasswordRemove() { ->getMock(); $userSession->method('getUser')->willReturn($user); - $ex = $this->getMockBuilder('\OC\DB\QueryBuilder\ExpressionBuilder\ExpressionBuilder') ->disableOriginalConstructor() ->getMock(); @@ -1292,7 +1284,6 @@ public function testSetPasswordRemove() { $ret->method('fetch')->willReturn(['uid_owner' => 'user']); $qb->method('execute')->willReturn($ret); - $connection = $this->getMockBuilder('\OC\DB\Connection') ->disableOriginalConstructor() ->getMock(); @@ -1323,7 +1314,6 @@ public function testSetPasswordInvalidShare() { ->getMock(); $userSession->method('getUser')->willReturn($user); - $ex = $this->getMockBuilder('\OC\DB\QueryBuilder\ExpressionBuilder\ExpressionBuilder') ->disableOriginalConstructor() ->getMock(); @@ -1345,7 +1335,6 @@ public function testSetPasswordInvalidShare() { $ret->method('fetch')->willReturn([]); $qb->method('execute')->willReturn($ret); - $connection = $this->getMockBuilder('\OC\DB\Connection') ->disableOriginalConstructor() ->getMock(); @@ -1355,7 +1344,6 @@ public function testSetPasswordInvalidShare() { ->disableOriginalConstructor() ->getMock(); - \OC\Share\Share::setPassword($userSession, $connection, $config, 1, 'pass'); } @@ -1376,7 +1364,6 @@ public function testSetPasswordShareOtherUser() { ->getMock(); $userSession->method('getUser')->willReturn($user); - $ex = $this->getMockBuilder('\OC\DB\QueryBuilder\ExpressionBuilder\ExpressionBuilder') ->disableOriginalConstructor() ->getMock(); @@ -1398,7 +1385,6 @@ public function testSetPasswordShareOtherUser() { $ret->method('fetch')->willReturn(['uid_owner' => 'user2']); $qb->method('execute')->willReturn($ret); - $connection = $this->getMockBuilder('\OC\DB\Connection') ->disableOriginalConstructor() ->getMock(); @@ -1408,7 +1394,6 @@ public function testSetPasswordShareOtherUser() { ->disableOriginalConstructor() ->getMock(); - \OC\Share\Share::setPassword($userSession, $connection, $config, 1, 'pass'); } @@ -1497,7 +1482,6 @@ public function testShareWithSelfError() { } } - public function testShareWithOwnerError() { \OC_User::setUserId($this->user1); diff --git a/tests/lib/Share20/DefaultShareProviderTest.php b/tests/lib/Share20/DefaultShareProviderTest.php index 7f1b5c4f9d61..327a98697127 100644 --- a/tests/lib/Share20/DefaultShareProviderTest.php +++ b/tests/lib/Share20/DefaultShareProviderTest.php @@ -118,8 +118,6 @@ private function addShareToDB($shareType, $sharedWith, $sharedBy, $shareOwner, return$qb->getLastInsertId(); } - - /** * @expectedException \OCP\Share\Exceptions\ShareNotFound */ @@ -2433,7 +2431,6 @@ public function testUpdateGroupSubShares() { $this->assertSame('user5', $shares[1]['uid_owner']); $this->assertSame(0, (int)$shares[1]['permissions']); - $stmt->closeCursor(); } diff --git a/tests/lib/Share20/ManagerTest.php b/tests/lib/Share20/ManagerTest.php index b5f95ac04034..b2674078faf5 100644 --- a/tests/lib/Share20/ManagerTest.php +++ b/tests/lib/Share20/ManagerTest.php @@ -227,7 +227,6 @@ public function testDelete($shareType, $sharedWith) { ], ]; - $hookListner ->expects($this->exactly(1)) ->method('pre') @@ -325,7 +324,6 @@ public function testDeleteLazyShare() { ], ]; - $hookListner ->expects($this->exactly(1)) ->method('pre') @@ -799,7 +797,6 @@ public function testGeneralChecks($share, $exceptionMessage, $exception) { $userFolder->method('getPath')->willReturn('myrootfolder'); $this->rootFolder->method('getUserFolder')->willReturn($userFolder); - try { $this->invokePrivate($this->manager, 'generalCreateChecks', [$share]); $thrown = false; @@ -2181,7 +2178,6 @@ public function testGetAllSharesByExpiration() { $today = new \DateTime(); $shareExpired->method('getExpirationDate')->willReturn($today); - $node = $this->createMock('OCP\Files\Folder'); $node->expects($this->any()) ->method('getId') @@ -2846,7 +2842,6 @@ public function testUpdateShareLink() { \OCP\Util::connectHook('OCP\Share', 'post_update_permissions', $hookListner2, 'post'); $hookListner2->expects($this->never())->method('post'); - $calledAfterUpdate = []; $this->eventDispatcher->addListener('share.afterupdate', function (GenericEvent $event) use (&$calledAfterUpdate) { diff --git a/tests/lib/Share20/ShareTest.php b/tests/lib/Share20/ShareTest.php index c53224673b44..cbed2bb196e0 100644 --- a/tests/lib/Share20/ShareTest.php +++ b/tests/lib/Share20/ShareTest.php @@ -53,7 +53,6 @@ public function testSetIdInt() { $this->assertEquals('42', $this->share->getId()); } - public function testSetIdString() { $this->share->setId('foo'); $this->assertEquals('foo', $this->share->getId()); @@ -76,7 +75,6 @@ public function testSetProviderIdInt() { $this->share->setProviderId(42); } - public function testSetProviderIdString() { $this->share->setProviderId('foo'); $this->share->setId('bar'); diff --git a/tests/lib/Template/BaseTest.php b/tests/lib/Template/BaseTest.php index 0231168a2d68..cdb6919dd0ef 100644 --- a/tests/lib/Template/BaseTest.php +++ b/tests/lib/Template/BaseTest.php @@ -11,7 +11,6 @@ use OC\Template\Base; use OCP\Theme\ITheme; - class BaseTest extends \Test\TestCase { /** @var ITheme|\PHPUnit_Framework_MockObject_MockObject */ @@ -28,7 +27,6 @@ protected function setUp() { ->getMock(); } - public function testTemplateIsLocatedWhenThemeIsActive() { $base = $this->getMockBuilder(Base::class) ->disableOriginalConstructor() diff --git a/tests/lib/Template/CSSResourceLocatorTest.php b/tests/lib/Template/CSSResourceLocatorTest.php index 224abf122c1c..6006f6631a8c 100644 --- a/tests/lib/Template/CSSResourceLocatorTest.php +++ b/tests/lib/Template/CSSResourceLocatorTest.php @@ -23,7 +23,6 @@ class CSSResourceLocatorTest extends TestCase { protected $appRoot = '/var/www/apps'; protected $themeAppDir = 'theme-best'; - protected function setUp() { parent::setUp(); $this->logger = $this->createMock(ILogger::class); diff --git a/tests/lib/Template/JSResourceLocatorTest.php b/tests/lib/Template/JSResourceLocatorTest.php index 6970072bced8..244d98fc81f5 100644 --- a/tests/lib/Template/JSResourceLocatorTest.php +++ b/tests/lib/Template/JSResourceLocatorTest.php @@ -23,7 +23,6 @@ class JSResourceLocatorTest extends TestCase { protected $appRoot = '/var/www/apps'; protected $themeAppDir = 'theme-best'; - protected function setUp() { parent::setUp(); $this->logger = $this->createMock(ILogger::class); @@ -102,7 +101,6 @@ public function testFindAppScript() { $locator->find(['randomapp/js/script']); } - public function testFindL10nScript() { /** @var \OC\Template\JSResourceLocator $locator */ $locator = $this->getResourceLocator( diff --git a/tests/lib/TestCase.php b/tests/lib/TestCase.php index 65a7fa0727b6..d3763170c461 100644 --- a/tests/lib/TestCase.php +++ b/tests/lib/TestCase.php @@ -79,7 +79,6 @@ public function restoreService($name) { return $oldService; }); - unset($this->services[$name]); return true; } @@ -508,7 +507,6 @@ protected function assertHtmlStringEqualsHtmlString($expectedHtml, $actualHtml, self::assertEquals($expectedHtml1, $actualHtml1, $message); } - private function removeWhitespaces(DOMNode $domNode) { foreach ($domNode->childNodes as $node) { if($node->hasChildNodes()) { diff --git a/tests/lib/User/AccountMapperTest.php b/tests/lib/User/AccountMapperTest.php index a4ca009992cb..d373a6310316 100644 --- a/tests/lib/User/AccountMapperTest.php +++ b/tests/lib/User/AccountMapperTest.php @@ -21,7 +21,6 @@ namespace Test\User; - use OC\User\Account; use OC\User\AccountMapper; use OC\User\AccountTermMapper; @@ -170,7 +169,6 @@ public function testFindLimitAndOffset() { $this->assertEquals("TestFind4", \array_shift($result)->getUserId()); } - public function findUserIdsDataProvider() { return [ [self::class, null, null, ['TestFind1','TestFind2','TestFind3','TestFind4']], diff --git a/tests/lib/User/BasicAuthModuleTest.php b/tests/lib/User/BasicAuthModuleTest.php index 1388e1f4b461..89c05285c086 100644 --- a/tests/lib/User/BasicAuthModuleTest.php +++ b/tests/lib/User/BasicAuthModuleTest.php @@ -20,10 +20,8 @@ * */ - namespace Test\User; - use OC\User\BasicAuthModule; use OCP\AppFramework\Utility\ITimeFactory; use OCP\IConfig; @@ -167,7 +165,6 @@ public function providesCredentials() { ]; } - public function testTimeout() { $this->session->method('exists')->will($this->returnValueMap([ diff --git a/tests/lib/User/ManagerTest.php b/tests/lib/User/ManagerTest.php index 68b6b80fa78e..dc853568a57f 100644 --- a/tests/lib/User/ManagerTest.php +++ b/tests/lib/User/ManagerTest.php @@ -76,7 +76,6 @@ public function testGetBackends() { $this->assertEquals([$backend, $dummyDatabaseBackend], $this->manager->getBackends()); } - public function testUserExistsAccountExists() { $account = $this->createMock(Account::class); $this->accountMapper->expects($this->once())->method('getByUid')->with('foo')->willReturn($account); diff --git a/tests/lib/User/SessionTest.php b/tests/lib/User/SessionTest.php index e3868c7f581a..957951f13967 100644 --- a/tests/lib/User/SessionTest.php +++ b/tests/lib/User/SessionTest.php @@ -36,7 +36,6 @@ use OCP\Authentication\IApacheBackend; use OCP\UserInterface; - /** * @group DB * @package Test\User @@ -1009,7 +1008,6 @@ public function testCancelLogout() { $this->tokenProvider, $this->config, $this->logger, $this->serviceLoader, $this->userSyncService); $userSession->setUser($user); - $called['cancel'] = false; \OC::$server->getEventDispatcher()->addListener('\OC\User\Session::pre_logout', function ($event) use (&$called) { diff --git a/tests/lib/User/Sync/AllUsersIteratorTest.php b/tests/lib/User/Sync/AllUsersIteratorTest.php index 7381d3bbb7d6..2805e74738aa 100644 --- a/tests/lib/User/Sync/AllUsersIteratorTest.php +++ b/tests/lib/User/Sync/AllUsersIteratorTest.php @@ -21,7 +21,6 @@ namespace OC\User\Sync; - use OCP\UserInterface; use Test\TestCase; diff --git a/tests/lib/User/Sync/SeenUsersIteratorTest.php b/tests/lib/User/Sync/SeenUsersIteratorTest.php index 225adc67555a..6721b0bcb687 100644 --- a/tests/lib/User/Sync/SeenUsersIteratorTest.php +++ b/tests/lib/User/Sync/SeenUsersIteratorTest.php @@ -21,7 +21,6 @@ namespace OC\User\Sync; - use OC\User\AccountMapper; use OCP\UserInterface; use Test\TestCase; diff --git a/tests/lib/User/TokenAuthModuleTest.php b/tests/lib/User/TokenAuthModuleTest.php index d23dd6cf84fb..7398fdedcc94 100644 --- a/tests/lib/User/TokenAuthModuleTest.php +++ b/tests/lib/User/TokenAuthModuleTest.php @@ -19,10 +19,8 @@ * */ - namespace Test\User; - use OC\Authentication\Exceptions\InvalidTokenException; use OC\Authentication\Token\IProvider; use OC\Authentication\Token\IToken; diff --git a/tests/lib/Util/User/MemoryAccountMapper.php b/tests/lib/Util/User/MemoryAccountMapper.php index e8f4b7d854af..74a4d79c1b70 100644 --- a/tests/lib/Util/User/MemoryAccountMapper.php +++ b/tests/lib/Util/User/MemoryAccountMapper.php @@ -21,7 +21,6 @@ namespace Test\Util\User; - use OC\User\Account; use OC\User\AccountMapper; use OCP\AppFramework\Db\DoesNotExistException; diff --git a/tests/lib/UtilTest.php b/tests/lib/UtilTest.php index 57ccde9ca672..3f70a4c3f4a8 100644 --- a/tests/lib/UtilTest.php +++ b/tests/lib/UtilTest.php @@ -577,7 +577,6 @@ public function fullDomainDataProvider() { ['notsupportscheme://host.tld:port', false], ['http://host.tld:this-is-no-port', false], - // default ports ['http://host.tld/some/path', 'http://host.tld:80'], ['http://host.tld:/some/path', 'http://host.tld:80'], diff --git a/tests/lib/legacy/AppTest.php b/tests/lib/legacy/AppTest.php index a5ca633ed2cb..f1ab498ea534 100644 --- a/tests/lib/legacy/AppTest.php +++ b/tests/lib/legacy/AppTest.php @@ -17,10 +17,8 @@ * along with this program. If not, see */ - namespace Test\legacy; - use OC\NavigationManager; use Test\TestCase; From f9b0af00be321a4cc11c81b5c1c5d50366eb8ffa Mon Sep 17 00:00:00 2001 From: Phil Davis Date: Thu, 26 Apr 2018 15:03:59 +0545 Subject: [PATCH 7/8] Remove some excess white space --- core/ajax/share.php | 4 +--- lib/private/Files/Cache/Scanner.php | 2 +- lib/private/Files/Cache/Updater.php | 2 +- lib/private/NaturalSort.php | 2 +- 4 files changed, 4 insertions(+), 6 deletions(-) diff --git a/core/ajax/share.php b/core/ajax/share.php index 543664343fab..3f95692f2996 100644 --- a/core/ajax/share.php +++ b/core/ajax/share.php @@ -271,9 +271,7 @@ function usersInGroup($gid, $search = '', $limit = -1, $offset = 0) { } break; case 'getItem': - if (isset($_GET['itemType'], $_GET['itemSource'], $_GET['checkReshare'], $_GET['checkShares']) - - ) { + if (isset($_GET['itemType'], $_GET['itemSource'], $_GET['checkReshare'], $_GET['checkShares'])) { if ($_GET['checkReshare'] == 'true') { $reshare = OCP\Share::getItemSharedWithBySource( (string)$_GET['itemType'], diff --git a/lib/private/Files/Cache/Scanner.php b/lib/private/Files/Cache/Scanner.php index 9e06ca346ad3..b6c1ea9a8fc3 100644 --- a/lib/private/Files/Cache/Scanner.php +++ b/lib/private/Files/Cache/Scanner.php @@ -189,7 +189,7 @@ public function scanFile($file, $reuseExisting = 0, $parentId = -1, $cacheData = $fileId = $cacheData['fileid']; $data['fileid'] = $fileId; // only reuse data if the file hasn't explicitly changed - if (isset($data['storage_mtime'], $cacheData['storage_mtime']) && $data['storage_mtime'] === $cacheData['storage_mtime']) { + if (isset($data['storage_mtime'], $cacheData['storage_mtime']) && $data['storage_mtime'] === $cacheData['storage_mtime']) { $data['mtime'] = $cacheData['mtime']; if (($reuseExisting & self::REUSE_SIZE) && ($data['size'] === -1)) { $data['size'] = $cacheData['size']; diff --git a/lib/private/Files/Cache/Updater.php b/lib/private/Files/Cache/Updater.php index 3fd246345574..4495dfc00bc2 100644 --- a/lib/private/Files/Cache/Updater.php +++ b/lib/private/Files/Cache/Updater.php @@ -123,7 +123,7 @@ public function update($path, $time = null) { $data = $this->scanner->scan($path, Scanner::SCAN_SHALLOW, -1, false); if ( - isset($data['oldSize'], $data['size']) && + isset($data['oldSize'], $data['size']) && !$data['encrypted'] // encryption is a pita and touches the cache itself ) { $sizeDifference = $data['size'] - $data['oldSize']; diff --git a/lib/private/NaturalSort.php b/lib/private/NaturalSort.php index 287edabbe9fd..ddf8ff8cf56a 100644 --- a/lib/private/NaturalSort.php +++ b/lib/private/NaturalSort.php @@ -110,7 +110,7 @@ public function compare($a, $b) { $aa = self::naturalSortChunkify($a); $bb = self::naturalSortChunkify($b); - for ($x = 0; isset($aa[$x], $bb[$x]) ; $x++) { + for ($x = 0; isset($aa[$x], $bb[$x]); $x++) { $aChunk = $aa[$x]; $bChunk = $bb[$x]; if ($aChunk !== $bChunk) { From 3bbf8cab084ff3ca4051012f20e6939056303078 Mon Sep 17 00:00:00 2001 From: Phil Davis Date: Sat, 28 Apr 2018 12:43:04 +0545 Subject: [PATCH 8/8] Fix recent code-style issues in master --- lib/private/DB/MDB2SchemaReader.php | 1 - 1 file changed, 1 deletion(-) diff --git a/lib/private/DB/MDB2SchemaReader.php b/lib/private/DB/MDB2SchemaReader.php index 9f862f75268d..4f12d2c88214 100644 --- a/lib/private/DB/MDB2SchemaReader.php +++ b/lib/private/DB/MDB2SchemaReader.php @@ -249,7 +249,6 @@ private function loadField($table, $xml) { $primary = true; } - $table->addColumn($name, $type, $options); if ($primary) { $table->setPrimaryKey([$name]);