diff --git a/build/psalm-baseline.xml b/build/psalm-baseline.xml index 114dc479f1a..7de2b7161b8 100644 --- a/build/psalm-baseline.xml +++ b/build/psalm-baseline.xml @@ -2980,9 +2980,6 @@ - - - @@ -4010,9 +4007,6 @@ - - - @@ -4389,9 +4383,6 @@ - - - diff --git a/core/Command/Encryption/Enable.php b/core/Command/Encryption/Enable.php index 2c476185692..02045fa1a4b 100644 --- a/core/Command/Encryption/Enable.php +++ b/core/Command/Encryption/Enable.php @@ -42,8 +42,8 @@ class Enable extends Command { $output->writeln('No encryption module is loaded'); return 1; } - $defaultModule = $this->config->getAppValue('core', 'default_encryption_module', null); - if ($defaultModule === null) { + $defaultModule = $this->config->getAppValue('core', 'default_encryption_module'); + if ($defaultModule === '') { $output->writeln('No default module is set'); return 1; } diff --git a/lib/private/AppConfig.php b/lib/private/AppConfig.php index a245f3149d2..d023e688c00 100644 --- a/lib/private/AppConfig.php +++ b/lib/private/AppConfig.php @@ -1386,15 +1386,15 @@ class AppConfig implements IAppConfig { * * @param string $app app * @param string $key key - * @param string $default = null, default value if the key does not exist + * @param string $default - Default value if the key does not exist * - * @return ?string the value or $default + * @return string the value or $default * @deprecated 29.0.0 use getValue*() * * This function gets a value from the appconfig table. If the key does * not exist the default value will be returned */ - public function getValue($app, $key, $default = null) { + public function getValue($app, $key, $default = '') { $this->loadConfig($app); $this->matchAndApplyLexiconDefinition($app, $key); diff --git a/lib/private/Installer.php b/lib/private/Installer.php index 91d20a129ae..fd737d286ad 100644 --- a/lib/private/Installer.php +++ b/lib/private/Installer.php @@ -546,7 +546,7 @@ class Installer { while (false !== ($filename = readdir($dir))) { if ($filename[0] !== '.' and is_dir($app_dir['path'] . "/$filename")) { if (file_exists($app_dir['path'] . "/$filename/appinfo/info.xml")) { - if ($config->getAppValue($filename, 'installed_version', null) === null) { + if ($config->getAppValue($filename, 'installed_version') === '') { $enabled = $appManager->isDefaultEnabled($filename); if (($enabled || in_array($filename, $appManager->getAlwaysEnabledApps())) && $config->getAppValue($filename, 'enabled') !== 'no') { diff --git a/lib/private/legacy/OC_App.php b/lib/private/legacy/OC_App.php index 10b78e2a7ef..6dbef42594b 100644 --- a/lib/private/legacy/OC_App.php +++ b/lib/private/legacy/OC_App.php @@ -685,7 +685,7 @@ class OC_App { //set remote/public handlers if (array_key_exists('ocsid', $appData)) { \OC::$server->getConfig()->setAppValue($appId, 'ocsid', $appData['ocsid']); - } elseif (\OC::$server->getConfig()->getAppValue($appId, 'ocsid', null) !== null) { + } elseif (\OC::$server->getConfig()->getAppValue($appId, 'ocsid') !== '') { \OC::$server->getConfig()->deleteAppValue($appId, 'ocsid'); } foreach ($appData['remote'] as $name => $path) { diff --git a/tests/Core/Command/Encryption/EnableTest.php b/tests/Core/Command/Encryption/EnableTest.php index 32d1a7576f5..0e9655c29c7 100644 --- a/tests/Core/Command/Encryption/EnableTest.php +++ b/tests/Core/Command/Encryption/EnableTest.php @@ -48,9 +48,9 @@ class EnableTest extends TestCase { public static function dataEnable(): array { return [ - ['no', null, [], true, 'Encryption enabled', 'No encryption module is loaded'], - ['yes', null, [], false, 'Encryption is already enabled', 'No encryption module is loaded'], - ['no', null, ['OC_TEST_MODULE' => []], true, 'Encryption enabled', 'No default module is set'], + ['no', '', [], true, 'Encryption enabled', 'No encryption module is loaded'], + ['yes', '', [], false, 'Encryption is already enabled', 'No encryption module is loaded'], + ['no', '', ['OC_TEST_MODULE' => []], true, 'Encryption enabled', 'No default module is set'], ['no', 'OC_NO_MODULE', ['OC_TEST_MODULE' => []], true, 'Encryption enabled', 'The current default module does not exist: OC_NO_MODULE'], ['no', 'OC_TEST_MODULE', ['OC_TEST_MODULE' => []], true, 'Encryption enabled', 'Default module: OC_TEST_MODULE'], ]; @@ -79,7 +79,7 @@ class EnableTest extends TestCase { ->method('getAppValue') ->willReturnMap([ ['core', 'encryption_enabled', 'no', $oldStatus], - ['core', 'default_encryption_module', null, $defaultModule], + ['core', 'default_encryption_module', '', $defaultModule], ]); }