From 151271f832b28d1e1c803e2b2bc5f5e9fccf129a Mon Sep 17 00:00:00 2001 From: Joas Schilling Date: Thu, 30 Sep 2021 10:42:35 +0200 Subject: Remove dead code - Return was always an empty array - Return was not used by the one place that called the method - the continue can be removed as there is nothing else done inside the loop Signed-off-by: Joas Schilling --- lib/private/Updater.php | 19 ++----------------- 1 file changed, 2 insertions(+), 17 deletions(-) (limited to 'lib') diff --git a/lib/private/Updater.php b/lib/private/Updater.php index cffdac310cb..4ddb5e2b7cb 100644 --- a/lib/private/Updater.php +++ b/lib/private/Updater.php @@ -362,14 +362,12 @@ class Updater extends BasicEmitter { * This is important if you upgrade ownCloud and have non ported 3rd * party apps installed. * - * @return array * @throws \Exception */ - private function checkAppsRequirements(): array { + private function checkAppsRequirements(): void { $isCoreUpgrade = $this->isCodeUpgrade(); $apps = OC_App::getEnabledApps(); $version = implode('.', Util::getVersion()); - $disabledApps = []; $appManager = \OC::$server->getAppManager(); foreach ($apps as $app) { // check if the app is compatible with this version of Nextcloud @@ -378,23 +376,10 @@ class Updater extends BasicEmitter { if ($appManager->isShipped($app)) { throw new \UnexpectedValueException('The files of the app "' . $app . '" were not correctly replaced before running the update'); } - \OC::$server->getAppManager()->disableApp($app, true); + $appManager->disableApp($app, true); $this->emit('\OC\Updater', 'incompatibleAppDisabled', [$app]); } - // no need to disable any app in case this is a non-core upgrade - if (!$isCoreUpgrade) { - continue; - } - // shipped apps will remain enabled - if ($appManager->isShipped($app)) { - continue; - } - // authentication and session apps will remain enabled as well - if (OC_App::isType($app, ['session', 'authentication'])) { - continue; - } } - return $disabledApps; } /** -- cgit v1.2.3