diff --git a/build/psalm-baseline.xml b/build/psalm-baseline.xml index 9d4ef09a30b5d..b5a722c8e7c31 100644 --- a/build/psalm-baseline.xml +++ b/build/psalm-baseline.xml @@ -1639,8 +1639,7 @@ $files_list - - $freeSpace + $maxUploadFilesize $maxUploadFilesize @@ -1967,10 +1966,8 @@ - + $share->getId() - $shareId - $shareId (int)$data['id'] diff --git a/lib/private/AppFramework/Utility/SimpleContainer.php b/lib/private/AppFramework/Utility/SimpleContainer.php index 588f7e8a4b647..95693eddac220 100644 --- a/lib/private/AppFramework/Utility/SimpleContainer.php +++ b/lib/private/AppFramework/Utility/SimpleContainer.php @@ -53,9 +53,10 @@ public function __construct() { } /** - * @template T - * @param class-string $id - * @return T + * @psalm-suppress MoreSpecificImplementedParamType + * @psalm-template T + * @psalm-param class-string $id + * @psalm-return T */ public function get(string $id) { return $this->query($id); diff --git a/lib/private/Server.php b/lib/private/Server.php index 13bbf972abb0a..946c1c41e3ab6 100644 --- a/lib/private/Server.php +++ b/lib/private/Server.php @@ -163,6 +163,7 @@ use OCP\Encryption\IFile; use OCP\Encryption\Keys\IStorage; use OCP\EventDispatcher\IEventDispatcher; +use OCP\EventDispatcher\GenericEvent; use OCP\Federation\ICloudFederationFactory; use OCP\Federation\ICloudFederationProviderManager; use OCP\Federation\ICloudIdManager; @@ -248,7 +249,6 @@ use Psr\Container\ContainerInterface; use Psr\Log\LoggerInterface; use Symfony\Component\EventDispatcher\EventDispatcherInterface; -use Symfony\Component\EventDispatcher\GenericEvent; use OCA\Files_External\Service\UserStoragesService; use OCA\Files_External\Service\UserGlobalStoragesService; use OCA\Files_External\Service\GlobalStoragesService; @@ -982,7 +982,10 @@ public function __construct($webRoot, \OC\Config $config) { $this->registerAlias(ITrustedDomainHelper::class, TrustedDomainHelper::class); /** @deprecated 19.0.0 */ $this->registerDeprecatedAlias('Throttler', Throttler::class); - $this->registerService('IntegrityCodeChecker', function (ContainerInterface $c) { + + /** @deprecated 24.0.0 */ + $this->registerDeprecatedAlias('IntegrityCodeChecker', Checker::class); + $this->registerService(Checker::class, function (ContainerInterface $c) { // IConfig and IAppManager requires a working database. This code // might however be called when ownCloud is not yet setup. if (\OC::$server->get(SystemConfig::class)->getValue('installed', false)) { @@ -1156,8 +1159,9 @@ public function __construct($webRoot, \OC\Config $config) { /** @deprecated 19.0.0 */ $this->registerDeprecatedAlias('CommentsManager', ICommentsManager::class); - $this->registerAlias(\OC_Defaults::class, 'ThemingDefaults'); - $this->registerService('ThemingDefaults', function (Server $c) { + $this->registerAlias(\OC_Defaults::class, ThemingDefaults::class); + $this->registerDeprecatedAlias('ThemingDefaults', ThemingDefaults::class); + $this->registerService(ThemingDefaults::class, function (Server $c) { /* * Dark magic for autoloader. * If we do a class_exists it will try to load the class which will @@ -1206,7 +1210,9 @@ public function __construct($webRoot, \OC\Config $config) { $this->registerDeprecatedAlias('EventDispatcher', \OC\EventDispatcher\SymfonyAdapter::class); $this->registerAlias(EventDispatcherInterface::class, \OC\EventDispatcher\SymfonyAdapter::class); - $this->registerService('CryptoWrapper', function (ContainerInterface $c) { + /** @deprecated 24.0.0 */ + $this->registerDeprecatedAlias('CryptoWrapper', CryptoWrapper::class); + $this->registerService(CryptoWrapper::class, function (ContainerInterface $c) { // FIXME: Instantiiated here due to cyclic dependency $request = new Request( [ @@ -1261,7 +1267,7 @@ public function __construct($webRoot, \OC\Config $config) { $c->get(SymfonyAdapter::class), $c->get(IMailer::class), $c->get(IURLGenerator::class), - $c->get('ThemingDefaults'), + $c->get(ThemingDefaults::class), $c->get(IEventDispatcher::class), $c->get(IUserSession::class), $c->get(KnownUserService::class) @@ -1302,7 +1308,9 @@ public function __construct($webRoot, \OC\Config $config) { ); }); - $this->registerService('LockdownManager', function (ContainerInterface $c) { + /** @deprecated 24.0.0 */ + $this->registerDeprecatedAlias('LockdownManager', LockdownManager::class); + $this->registerService(LockdownManager::class, function (ContainerInterface $c): LockdownManager { return new LockdownManager(function () use ($c) { return $c->get(ISession::class); }); @@ -1645,6 +1653,7 @@ public function getUserSession() { * @deprecated 20.0.0 */ public function getSession() { + /** @psalm-suppress UndefinedInterfaceMethod */ return $this->get(IUserSession::class)->getSession(); } @@ -1653,6 +1662,7 @@ public function getSession() { */ public function setSession(\OCP\ISession $session) { $this->get(SessionStorage::class)->setSession($session); + /** @psalm-suppress UndefinedInterfaceMethod */ $this->get(IUserSession::class)->setSession($session); $this->get(Store::class)->setSession($session); } @@ -1763,7 +1773,7 @@ public function getMemCacheFactory() { * @deprecated 20.0.0 */ public function getGetRedisFactory() { - return $this->get('RedisFactory'); + return $this->get(RedisFactory::class); } @@ -1974,6 +1984,7 @@ public function getWebRoot() { * @deprecated 20.0.0 */ public function getOcsClient() { + /** @psalm-suppress UndefinedClass */ return $this->get('OcsClient'); } @@ -2117,11 +2128,11 @@ public function getCommentsManager() { } /** - * @return \OCA\Theming\ThemingDefaults + * @return ThemingDefaults * @deprecated 20.0.0 */ public function getThemingDefaults() { - return $this->get('ThemingDefaults'); + return $this->get(ThemingDefaults::class); } /** @@ -2129,15 +2140,15 @@ public function getThemingDefaults() { * @deprecated 20.0.0 */ public function getIntegrityCodeChecker() { - return $this->get('IntegrityCodeChecker'); + return $this->get(Checker::class); } /** - * @return \OC\Session\CryptoWrapper + * @return CryptoWrapper * @deprecated 20.0.0 */ public function getSessionCryptoWrapper() { - return $this->get('CryptoWrapper'); + return $this->get(CryptoWrapper::class); } /** @@ -2243,7 +2254,7 @@ public function getAutoCompleteManager() { * @deprecated 20.0.0 */ public function getLDAPProvider() { - return $this->get('LDAPProvider'); + return $this->get(\OCA\User_LDAP\LDAPProvider::class); } /** @@ -2269,7 +2280,7 @@ public function getAppDataDir($app) { * @deprecated 20.0.0 */ public function getLockdownManager() { - return $this->get('LockdownManager'); + return $this->get(LockdownManager::class); } /** diff --git a/lib/private/Template/Base.php b/lib/private/Template/Base.php index 2de8c7ad5b18c..66f51a6e9d88d 100644 --- a/lib/private/Template/Base.php +++ b/lib/private/Template/Base.php @@ -30,7 +30,6 @@ namespace OC\Template; use OCP\Defaults; -use Throwable; class Base { private $template; // The template @@ -92,7 +91,7 @@ protected function getCoreTemplateDirs($theme, $serverRoot) { /** * Assign variables * @param string $key key - * @param array|bool|integer|string|Throwable $value value + * @param mixed $value value * @return bool * * This function assigns a variable. It can be accessed via $_[$key] in