From f39666b47f30ae0024216d5b1ef49408faa034bd Mon Sep 17 00:00:00 2001 From: Julius Knorr Date: Tue, 17 Sep 2024 22:57:50 +0200 Subject: [PATCH] fixup! fixup! chore(legacy): Introduce public version class and drop version methods from OC_Util --- core/Command/Status.php | 1 - core/Controller/OCSController.php | 4 ++-- lib/composer/composer/autoload_classmap.php | 2 +- lib/composer/composer/autoload_static.php | 2 +- lib/private/IntegrityCheck/Checker.php | 1 - lib/private/Server.php | 1 - lib/private/legacy/OC_Util.php | 1 - tests/lib/IntegrityCheck/CheckerTest.php | 1 - tests/lib/Updater/VersionCheckTest.php | 1 - tests/lib/UtilTest.php | 1 - 10 files changed, 4 insertions(+), 11 deletions(-) diff --git a/core/Command/Status.php b/core/Command/Status.php index 9a0011154b0ec..a00d4a94658fd 100644 --- a/core/Command/Status.php +++ b/core/Command/Status.php @@ -7,7 +7,6 @@ */ namespace OC\Core\Command; -use OC_Util; use OCP\Defaults; use OCP\IConfig; use OCP\ServerVersion; diff --git a/core/Controller/OCSController.php b/core/Controller/OCSController.php index 6d83f86cfecdd..65ce55b8606b2 100644 --- a/core/Controller/OCSController.php +++ b/core/Controller/OCSController.php @@ -59,8 +59,8 @@ public function getCapabilities(): DataResponse { $result = []; $result['version'] = [ 'major' => $this->serverVersion->getMajorVersion(), - 'minor' => (int)$this->serverVersion->getMinorVersion(), - 'micro' => (int)$this->serverVersion->getPatchVersion(), + 'minor' => $this->serverVersion->getMinorVersion(), + 'micro' => $this->serverVersion->getPatchVersion(), 'string' => $this->serverVersion->getVersionString(), 'edition' => '', 'extendedSupport' => \OCP\Util::hasExtendedSupport() diff --git a/lib/composer/composer/autoload_classmap.php b/lib/composer/composer/autoload_classmap.php index 78aca5fe883a1..20273bcc3b1ee 100644 --- a/lib/composer/composer/autoload_classmap.php +++ b/lib/composer/composer/autoload_classmap.php @@ -687,6 +687,7 @@ 'OCP\\Security\\VerificationToken\\IVerificationToken' => $baseDir . '/lib/public/Security/VerificationToken/IVerificationToken.php', 'OCP\\Security\\VerificationToken\\InvalidTokenException' => $baseDir . '/lib/public/Security/VerificationToken/InvalidTokenException.php', 'OCP\\Server' => $baseDir . '/lib/public/Server.php', + 'OCP\\ServerVersion' => $baseDir . '/lib/public/ServerVersion.php', 'OCP\\Session\\Exceptions\\SessionNotAvailableException' => $baseDir . '/lib/public/Session/Exceptions/SessionNotAvailableException.php', 'OCP\\Settings\\DeclarativeSettingsTypes' => $baseDir . '/lib/public/Settings/DeclarativeSettingsTypes.php', 'OCP\\Settings\\Events\\DeclarativeSettingsGetValueEvent' => $baseDir . '/lib/public/Settings/Events/DeclarativeSettingsGetValueEvent.php', @@ -1647,7 +1648,6 @@ 'OC\\IntegrityCheck\\Checker' => $baseDir . '/lib/private/IntegrityCheck/Checker.php', 'OC\\IntegrityCheck\\Exceptions\\InvalidSignatureException' => $baseDir . '/lib/private/IntegrityCheck/Exceptions/InvalidSignatureException.php', 'OC\\IntegrityCheck\\Helpers\\AppLocator' => $baseDir . '/lib/private/IntegrityCheck/Helpers/AppLocator.php', - 'OC\\IntegrityCheck\\Helpers\\EnvironmentHelper' => $baseDir . '/lib/private/IntegrityCheck/Helpers/EnvironmentHelper.php', 'OC\\IntegrityCheck\\Helpers\\FileAccessHelper' => $baseDir . '/lib/private/IntegrityCheck/Helpers/FileAccessHelper.php', 'OC\\IntegrityCheck\\Iterator\\ExcludeFileByNameFilterIterator' => $baseDir . '/lib/private/IntegrityCheck/Iterator/ExcludeFileByNameFilterIterator.php', 'OC\\IntegrityCheck\\Iterator\\ExcludeFoldersByPathFilterIterator' => $baseDir . '/lib/private/IntegrityCheck/Iterator/ExcludeFoldersByPathFilterIterator.php', diff --git a/lib/composer/composer/autoload_static.php b/lib/composer/composer/autoload_static.php index 6a17bc4ff31fd..eb5bf40331988 100644 --- a/lib/composer/composer/autoload_static.php +++ b/lib/composer/composer/autoload_static.php @@ -720,6 +720,7 @@ class ComposerStaticInit749170dad3f5e7f9ca158f5a9f04f6a2 'OCP\\Security\\VerificationToken\\IVerificationToken' => __DIR__ . '/../../..' . '/lib/public/Security/VerificationToken/IVerificationToken.php', 'OCP\\Security\\VerificationToken\\InvalidTokenException' => __DIR__ . '/../../..' . '/lib/public/Security/VerificationToken/InvalidTokenException.php', 'OCP\\Server' => __DIR__ . '/../../..' . '/lib/public/Server.php', + 'OCP\\ServerVersion' => __DIR__ . '/../../..' . '/lib/public/ServerVersion.php', 'OCP\\Session\\Exceptions\\SessionNotAvailableException' => __DIR__ . '/../../..' . '/lib/public/Session/Exceptions/SessionNotAvailableException.php', 'OCP\\Settings\\DeclarativeSettingsTypes' => __DIR__ . '/../../..' . '/lib/public/Settings/DeclarativeSettingsTypes.php', 'OCP\\Settings\\Events\\DeclarativeSettingsGetValueEvent' => __DIR__ . '/../../..' . '/lib/public/Settings/Events/DeclarativeSettingsGetValueEvent.php', @@ -1680,7 +1681,6 @@ class ComposerStaticInit749170dad3f5e7f9ca158f5a9f04f6a2 'OC\\IntegrityCheck\\Checker' => __DIR__ . '/../../..' . '/lib/private/IntegrityCheck/Checker.php', 'OC\\IntegrityCheck\\Exceptions\\InvalidSignatureException' => __DIR__ . '/../../..' . '/lib/private/IntegrityCheck/Exceptions/InvalidSignatureException.php', 'OC\\IntegrityCheck\\Helpers\\AppLocator' => __DIR__ . '/../../..' . '/lib/private/IntegrityCheck/Helpers/AppLocator.php', - 'OC\\IntegrityCheck\\Helpers\\EnvironmentHelper' => __DIR__ . '/../../..' . '/lib/private/IntegrityCheck/Helpers/EnvironmentHelper.php', 'OC\\IntegrityCheck\\Helpers\\FileAccessHelper' => __DIR__ . '/../../..' . '/lib/private/IntegrityCheck/Helpers/FileAccessHelper.php', 'OC\\IntegrityCheck\\Iterator\\ExcludeFileByNameFilterIterator' => __DIR__ . '/../../..' . '/lib/private/IntegrityCheck/Iterator/ExcludeFileByNameFilterIterator.php', 'OC\\IntegrityCheck\\Iterator\\ExcludeFoldersByPathFilterIterator' => __DIR__ . '/../../..' . '/lib/private/IntegrityCheck/Iterator/ExcludeFoldersByPathFilterIterator.php', diff --git a/lib/private/IntegrityCheck/Checker.php b/lib/private/IntegrityCheck/Checker.php index a8ecc9426987a..22465361302b7 100644 --- a/lib/private/IntegrityCheck/Checker.php +++ b/lib/private/IntegrityCheck/Checker.php @@ -11,7 +11,6 @@ use OC\Core\Command\Maintenance\Mimetype\GenerateMimetypeFileBuilder; use OC\IntegrityCheck\Exceptions\InvalidSignatureException; use OC\IntegrityCheck\Helpers\AppLocator; -use OC\IntegrityCheck\Helpers\EnvironmentHelper; use OC\IntegrityCheck\Helpers\FileAccessHelper; use OC\IntegrityCheck\Iterator\ExcludeFileByNameFilterIterator; use OC\IntegrityCheck\Iterator\ExcludeFoldersByPathFilterIterator; diff --git a/lib/private/Server.php b/lib/private/Server.php index 3ed645c046130..de553a7e9f90c 100644 --- a/lib/private/Server.php +++ b/lib/private/Server.php @@ -63,7 +63,6 @@ use OC\Http\Client\NegativeDnsCache; use OC\IntegrityCheck\Checker; use OC\IntegrityCheck\Helpers\AppLocator; -use OC\IntegrityCheck\Helpers\EnvironmentHelper; use OC\IntegrityCheck\Helpers\FileAccessHelper; use OC\KnownUser\KnownUserService; use OC\LDAP\NullLDAPProviderFactory; diff --git a/lib/private/legacy/OC_Util.php b/lib/private/legacy/OC_Util.php index 6ff59118e23f7..95d23d7a69c0e 100644 --- a/lib/private/legacy/OC_Util.php +++ b/lib/private/legacy/OC_Util.php @@ -16,7 +16,6 @@ use OCP\IUser; use OCP\L10N\IFactory; use OCP\Security\ISecureRandom; -use OCP\ServerVersion; use OCP\Share\IManager; use Psr\Log\LoggerInterface; diff --git a/tests/lib/IntegrityCheck/CheckerTest.php b/tests/lib/IntegrityCheck/CheckerTest.php index 8c29c0f11ab3a..bf1ece7c3a4a6 100644 --- a/tests/lib/IntegrityCheck/CheckerTest.php +++ b/tests/lib/IntegrityCheck/CheckerTest.php @@ -10,7 +10,6 @@ use OC\Core\Command\Maintenance\Mimetype\GenerateMimetypeFileBuilder; use OC\IntegrityCheck\Checker; use OC\IntegrityCheck\Helpers\AppLocator; -use OC\IntegrityCheck\Helpers\EnvironmentHelper; use OC\IntegrityCheck\Helpers\FileAccessHelper; use OC\Memcache\NullCache; use OCP\App\IAppManager; diff --git a/tests/lib/Updater/VersionCheckTest.php b/tests/lib/Updater/VersionCheckTest.php index ab1448b346ba0..4bdd513d17d34 100644 --- a/tests/lib/Updater/VersionCheckTest.php +++ b/tests/lib/Updater/VersionCheckTest.php @@ -14,7 +14,6 @@ use OCP\IUserManager; use OCP\ServerVersion; use OCP\Support\Subscription\IRegistry; -use OCP\Util; use Psr\Log\LoggerInterface; class VersionCheckTest extends \Test\TestCase { diff --git a/tests/lib/UtilTest.php b/tests/lib/UtilTest.php index 1f9fb70511233..c1dea8d542328 100644 --- a/tests/lib/UtilTest.php +++ b/tests/lib/UtilTest.php @@ -8,7 +8,6 @@ namespace Test; use OC_Util; -use OCP\ServerVersion; /** * Class UtilTest