From eccc727f4ee2c322ebc56e62d32cf8976c4489d5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=B4me=20Chilliet?= Date: Thu, 15 May 2025 10:38:47 +0200 Subject: [PATCH] fix: Remove more unused deprecated getters from IServerContainer MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Côme Chilliet --- lib/public/IServerContainer.php | 57 ------------------- .../IContentSecurityPolicyManager.php | 2 +- 2 files changed, 1 insertion(+), 58 deletions(-) diff --git a/lib/public/IServerContainer.php b/lib/public/IServerContainer.php index 532cd8dffb2..6d5095c92da 100644 --- a/lib/public/IServerContainer.php +++ b/lib/public/IServerContainer.php @@ -8,8 +8,6 @@ declare(strict_types=1); */ namespace OCP; -use OCP\Federation\ICloudFederationProviderManager; -use OCP\Security\IContentSecurityPolicyManager; use Psr\Container\ContainerInterface; /** @@ -93,15 +91,6 @@ interface IServerContainer extends ContainerInterface, IContainer { */ public function getUserSession(); - /** - * Returns the navigation manager - * - * @return \OCP\INavigationManager - * @since 6.0.0 - * @deprecated 20.0.0 have it injected or fetch it through \Psr\Container\ContainerInterface::get - */ - public function getNavigationManager(); - /** * Returns the config manager * @@ -138,15 +127,6 @@ interface IServerContainer extends ContainerInterface, IContainer { */ public function getSecureRandom(); - /** - * Returns the app config manager - * - * @return \OCP\IAppConfig - * @since 7.0.0 - * @deprecated 20.0.0 have it injected or fetch it through \Psr\Container\ContainerInterface::get - */ - public function getAppConfig(); - /** * @return \OCP\L10N\IFactory * @since 8.2.0 @@ -250,15 +230,6 @@ interface IServerContainer extends ContainerInterface, IContainer { */ public function getCertificateManager(); - /** - * Returns an instance of the HTTP client service - * - * @return \OCP\Http\Client\IClientService - * @since 8.1.0 - * @deprecated 20.0.0 have it injected or fetch it through \Psr\Container\ContainerInterface::get - */ - public function getHTTPClientService(); - /** * Get the manager for temporary files and folders * @@ -304,13 +275,6 @@ interface IServerContainer extends ContainerInterface, IContainer { */ public function getLockingProvider(); - /** - * @return \OCP\Files\Mount\IMountManager - * @since 8.2.0 - * @deprecated 20.0.0 have it injected or fetch it through \Psr\Container\ContainerInterface::get - */ - public function getMountManager(); - /** * Get the MimeTypeDetector * @@ -338,31 +302,10 @@ interface IServerContainer extends ContainerInterface, IContainer { */ public function getNotificationManager(); - /** - * @return IContentSecurityPolicyManager - * @since 9.0.0 - * @deprecated 17.0.0 Use the AddContentSecurityPolicyEvent - */ - public function getContentSecurityPolicyManager(); - /** * @return \OCP\Federation\ICloudIdManager * @since 12.0.0 * @deprecated 20.0.0 have it injected or fetch it through \Psr\Container\ContainerInterface::get */ public function getCloudIdManager(); - - /** - * @return \OCP\GlobalScale\IConfig - * @since 14.0.0 - * @deprecated 20.0.0 have it injected or fetch it through \Psr\Container\ContainerInterface::get - */ - public function getGlobalScaleConfig(); - - /** - * @return ICloudFederationProviderManager - * @since 14.0.0 - * @deprecated 20.0.0 have it injected or fetch it through \Psr\Container\ContainerInterface::get - */ - public function getCloudFederationProviderManager(); } diff --git a/lib/public/Security/IContentSecurityPolicyManager.php b/lib/public/Security/IContentSecurityPolicyManager.php index 3df0da465b2..00cdcc2c454 100644 --- a/lib/public/Security/IContentSecurityPolicyManager.php +++ b/lib/public/Security/IContentSecurityPolicyManager.php @@ -24,7 +24,7 @@ interface IContentSecurityPolicyManager { * Note that the adjustment is only applied to applications that use AppFramework * controllers. * - * To use this from your `app.php` use `\OC::$server->getContentSecurityPolicyManager()->addDefaultPolicy($policy)`, + * To use this from your `app.php` use `\OCP\Server::get(IContentSecurityPolicyManager::class)->addDefaultPolicy($policy)`, * $policy has to be of type `\OCP\AppFramework\Http\ContentSecurityPolicy`. * * WARNING: Using this API incorrectly may make the instance more insecure.