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..803868e9c880f 100644 --- a/lib/private/Server.php +++ b/lib/private/Server.php @@ -123,6 +123,7 @@ use OC\Preview\GeneratorHelper; use OC\Remote\Api\ApiFactory; use OC\Remote\InstanceFactory; +use OC\RedisFactory; use OC\RichObjectStrings\Validator; use OC\Route\Router; use OC\Security\Bruteforce\Throttler; @@ -163,6 +164,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 +250,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; @@ -1156,8 +1157,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->registerAlias('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 @@ -1261,7 +1263,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) @@ -1645,6 +1647,7 @@ public function getUserSession() { * @deprecated 20.0.0 */ public function getSession() { + /** @psalm-suppress UndefinedInterfaceMethod */ return $this->get(IUserSession::class)->getSession(); } @@ -1653,6 +1656,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 +1767,7 @@ public function getMemCacheFactory() { * @deprecated 20.0.0 */ public function getGetRedisFactory() { - return $this->get('RedisFactory'); + return $this->get(RedisFactory::class); } @@ -2117,11 +2121,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); } /** @@ -2243,7 +2247,7 @@ public function getAutoCompleteManager() { * @deprecated 20.0.0 */ public function getLDAPProvider() { - return $this->get('LDAPProvider'); + return $this->get(\OCA\User_LDAP\LDAPProvider::class); } /** diff --git a/lib/private/Template/Base.php b/lib/private/Template/Base.php index 2de8c7ad5b18c..fedffa6eab663 100644 --- a/lib/private/Template/Base.php +++ b/lib/private/Template/Base.php @@ -92,7 +92,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