summaryrefslogtreecommitdiffstats
path: root/apps
diff options
context:
space:
mode:
authorCarl Schwan <carl@carlschwan.eu>2022-01-06 16:57:32 +0100
committerCarl Schwan <carl@carlschwan.eu>2022-01-12 20:03:06 +0100
commitaeecb72e96e54439f98822467bb727366207039f (patch)
treeb77aee20add8d099a271131e0b4b0986426e5df1 /apps
parent47c9c34cca22602fb609de6c0e1d32ec17a9e7fe (diff)
downloadnextcloud-server-aeecb72e96e54439f98822467bb727366207039f.tar.gz
nextcloud-server-aeecb72e96e54439f98822467bb727366207039f.zip
Fix a few psalm issues and moved back to psalm/phar 4.18
Signed-off-by: Carl Schwan <carl@carlschwan.eu>
Diffstat (limited to 'apps')
-rw-r--r--apps/encryption/lib/Crypto/Crypt.php4
-rw-r--r--apps/encryption/lib/KeyManager.php2
-rw-r--r--apps/encryption/lib/Migration/SetMasterKeyStatus.php4
-rw-r--r--apps/encryption/lib/Recovery.php2
-rw-r--r--apps/files_external/lib/Lib/Storage/FtpConnection.php2
-rw-r--r--apps/settings/lib/SetupChecks/CheckUserCertificates.php5
-rw-r--r--apps/user_ldap/lib/Access.php2
7 files changed, 9 insertions, 12 deletions
diff --git a/apps/encryption/lib/Crypto/Crypt.php b/apps/encryption/lib/Crypto/Crypt.php
index 8a6be4d3809..93120068c6a 100644
--- a/apps/encryption/lib/Crypto/Crypt.php
+++ b/apps/encryption/lib/Crypto/Crypt.php
@@ -237,7 +237,7 @@ class Crypt {
$encryptedContent = openssl_encrypt($plainContent,
$cipher,
$passPhrase,
- false,
+ 0,
$iv);
if (!$encryptedContent) {
@@ -617,7 +617,7 @@ class Crypt {
$plainContent = openssl_decrypt($encryptedContent,
$cipher,
$passPhrase,
- false,
+ 0,
$iv);
if ($plainContent) {
diff --git a/apps/encryption/lib/KeyManager.php b/apps/encryption/lib/KeyManager.php
index 4a2c6c16e2b..ffd07c0f323 100644
--- a/apps/encryption/lib/KeyManager.php
+++ b/apps/encryption/lib/KeyManager.php
@@ -159,7 +159,7 @@ class KeyManager {
$this->config->setAppValue('encryption', 'masterKeyId', $this->masterKeyId);
}
- $this->keyId = $userSession && $userSession->isLoggedIn() ? $userSession->getUser()->getUID() : false;
+ $this->keyId = $userSession->isLoggedIn() ? $userSession->getUser()->getUID() : false;
$this->log = $log;
}
diff --git a/apps/encryption/lib/Migration/SetMasterKeyStatus.php b/apps/encryption/lib/Migration/SetMasterKeyStatus.php
index 9e800ac7cd3..a80d7144cc4 100644
--- a/apps/encryption/lib/Migration/SetMasterKeyStatus.php
+++ b/apps/encryption/lib/Migration/SetMasterKeyStatus.php
@@ -62,8 +62,8 @@ class SetMasterKeyStatus implements IRepairStep {
// if no config for the master key is set we set it explicitly to '0' in
// order not to break old installations because the default changed to '1'.
- $configAlreadySet = $this->config->getAppValue('encryption', 'useMasterKey', false);
- if ($configAlreadySet === false) {
+ $configAlreadySet = $this->config->getAppValue('encryption', 'useMasterKey', 'not-set');
+ if ($configAlreadySet === 'not-set') {
$this->config->setAppValue('encryption', 'useMasterKey', '0');
}
}
diff --git a/apps/encryption/lib/Recovery.php b/apps/encryption/lib/Recovery.php
index 22a668cd5b0..f4336ec7c4e 100644
--- a/apps/encryption/lib/Recovery.php
+++ b/apps/encryption/lib/Recovery.php
@@ -76,7 +76,7 @@ class Recovery {
IConfig $config,
IFile $file,
View $view) {
- $this->user = ($userSession && $userSession->isLoggedIn()) ? $userSession->getUser() : false;
+ $this->user = ($userSession->isLoggedIn()) ? $userSession->getUser() : null;
$this->crypt = $crypt;
$this->keyManager = $keyManager;
$this->config = $config;
diff --git a/apps/files_external/lib/Lib/Storage/FtpConnection.php b/apps/files_external/lib/Lib/Storage/FtpConnection.php
index d87c44656f4..bc4be18e42e 100644
--- a/apps/files_external/lib/Lib/Storage/FtpConnection.php
+++ b/apps/files_external/lib/Lib/Storage/FtpConnection.php
@@ -27,7 +27,7 @@ namespace OCA\Files_External\Lib\Storage;
* Low level wrapper around the ftp functions that smooths over some difference between servers
*/
class FtpConnection {
- /** @var resource */
+ /** @var resource|\FTP\Connection */
private $connection;
public function __construct(bool $secure, string $hostname, int $port, string $username, string $password) {
diff --git a/apps/settings/lib/SetupChecks/CheckUserCertificates.php b/apps/settings/lib/SetupChecks/CheckUserCertificates.php
index eff5b4d7515..52fea7b6551 100644
--- a/apps/settings/lib/SetupChecks/CheckUserCertificates.php
+++ b/apps/settings/lib/SetupChecks/CheckUserCertificates.php
@@ -39,10 +39,7 @@ class CheckUserCertificates {
public function __construct(IL10N $l10n, IConfig $config, IURLGenerator $urlGenerator) {
$this->l10n = $l10n;
- $configValue = $config->getAppValue('files_external', 'user_certificate_scan', false);
- if (!is_string($configValue)) {
- $configValue = '';
- }
+ $configValue = $config->getAppValue('files_external', 'user_certificate_scan', '');
$this->configValue = $configValue;
$this->urlGenerator = $urlGenerator;
}
diff --git a/apps/user_ldap/lib/Access.php b/apps/user_ldap/lib/Access.php
index f79efe90996..093449ee0ea 100644
--- a/apps/user_ldap/lib/Access.php
+++ b/apps/user_ldap/lib/Access.php
@@ -1753,7 +1753,7 @@ class Access extends LDAPUtility {
}
$attribute = $this->connection->getFromCache($uuidAttr);
- if (!$attribute === null) {
+ if ($attribute !== null) {
$this->connection->$uuidAttr = $attribute;
return true;
}