From 54eaad76c0eb9015fc9eff82f90d82f368e71334 Mon Sep 17 00:00:00 2001 From: Ferdinand Thiessen Date: Thu, 15 May 2025 14:11:47 +0200 Subject: [PATCH] chore!(\OCP\Files): remove deprecated static `getStorage` method Was deprecated since Nextcloud 14 and is not used anymore. Removing allows us to clean the OCP psalm baseline. Signed-off-by: Ferdinand Thiessen --- build/psalm-baseline-ocp.xml | 3 --- build/psalm-baseline.xml | 5 ----- lib/private/legacy/OC_App.php | 22 ---------------------- lib/public/Files.php | 12 ------------ 4 files changed, 42 deletions(-) diff --git a/build/psalm-baseline-ocp.xml b/build/psalm-baseline-ocp.xml index ed932f8d487..7a2ecafc3d4 100644 --- a/build/psalm-baseline-ocp.xml +++ b/build/psalm-baseline-ocp.xml @@ -41,9 +41,6 @@ - - - diff --git a/build/psalm-baseline.xml b/build/psalm-baseline.xml index 9848dfd3951..0e9f2e6cae6 100644 --- a/build/psalm-baseline.xml +++ b/build/psalm-baseline.xml @@ -4721,11 +4721,6 @@ - - - - - diff --git a/lib/private/legacy/OC_App.php b/lib/private/legacy/OC_App.php index ecceafa65b3..abac0d2635e 100644 --- a/lib/private/legacy/OC_App.php +++ b/lib/private/legacy/OC_App.php @@ -768,28 +768,6 @@ class OC_App { } } - /** - * @param string $appId - * @return \OC\Files\View|false - */ - public static function getStorage(string $appId) { - if (\OC::$server->getAppManager()->isEnabledForUser($appId)) { //sanity check - if (\OC::$server->getUserSession()->isLoggedIn()) { - $view = new \OC\Files\View('/' . OC_User::getUser()); - if (!$view->file_exists($appId)) { - $view->mkdir($appId); - } - return new \OC\Files\View('/' . OC_User::getUser() . '/' . $appId); - } else { - \OCP\Server::get(LoggerInterface::class)->error('Can\'t get app storage, app ' . $appId . ', user not logged in', ['app' => 'core']); - return false; - } - } else { - \OCP\Server::get(LoggerInterface::class)->error('Can\'t get app storage, app ' . $appId . ' not enabled', ['app' => 'core']); - return false; - } - } - protected static function findBestL10NOption(array $options, string $lang): string { // only a single option if (isset($options['@value'])) { diff --git a/lib/public/Files.php b/lib/public/Files.php index fb03a4192fc..e3475981aef 100644 --- a/lib/public/Files.php +++ b/lib/public/Files.php @@ -105,16 +105,4 @@ class Files { public static function buildNotExistingFileName($path, $filename) { return \OC_Helper::buildNotExistingFileName($path, $filename); } - - /** - * Gets the Storage for an app - creates the needed folder if they are not - * existent - * @param string $app - * @return \OC\Files\View - * @since 5.0.0 - * @deprecated 14.0.0 use IAppData instead - */ - public static function getStorage($app) { - return \OC_App::getStorage($app); - } }