diff options
author | provokateurin <kate@provokateurin.de> | 2024-10-18 12:40:17 +0200 |
---|---|---|
committer | provokateurin <kate@provokateurin.de> | 2024-10-21 12:37:59 +0200 |
commit | e8426996f59ab6dbf0c94adee8f410cbd572b11a (patch) | |
tree | 70f296c1177c9632865688a54f7f68e5524ccc67 /apps | |
parent | 381077028adf388a7081cf42026570c6be47b198 (diff) | |
download | nextcloud-server-e8426996f59ab6dbf0c94adee8f410cbd572b11a.tar.gz nextcloud-server-e8426996f59ab6dbf0c94adee8f410cbd572b11a.zip |
fix(psalm): Fix some newly detected issuesrefactor/apps/constructor-property-promotion
Signed-off-by: provokateurin <kate@provokateurin.de>
Diffstat (limited to 'apps')
-rw-r--r-- | apps/dav/lib/Avatars/AvatarNode.php | 6 | ||||
-rw-r--r-- | apps/dav/lib/CardDAV/Xml/Groups.php | 4 | ||||
-rw-r--r-- | apps/dav/lib/Connector/Sabre/Directory.php | 4 | ||||
-rw-r--r-- | apps/encryption/lib/Util.php | 9 | ||||
-rw-r--r-- | apps/files_external/lib/Config/UserContext.php | 2 | ||||
-rw-r--r-- | apps/user_ldap/lib/LDAPProvider.php | 4 |
6 files changed, 8 insertions, 21 deletions
diff --git a/apps/dav/lib/Avatars/AvatarNode.php b/apps/dav/lib/Avatars/AvatarNode.php index 98ee67d3c78..b3a605fbb02 100644 --- a/apps/dav/lib/Avatars/AvatarNode.php +++ b/apps/dav/lib/Avatars/AvatarNode.php @@ -69,10 +69,6 @@ class AvatarNode extends File { } public function getLastModified() { - $timestamp = $this->avatar->getFile($this->size)->getMTime(); - if (!empty($timestamp)) { - return (int)$timestamp; - } - return $timestamp; + return $this->avatar->getFile($this->size)->getMTime(); } } diff --git a/apps/dav/lib/CardDAV/Xml/Groups.php b/apps/dav/lib/CardDAV/Xml/Groups.php index 568907813af..07aeecb3fa2 100644 --- a/apps/dav/lib/CardDAV/Xml/Groups.php +++ b/apps/dav/lib/CardDAV/Xml/Groups.php @@ -14,10 +14,10 @@ class Groups implements XmlSerializable { public const NS_OWNCLOUD = 'http://owncloud.org/ns'; /** - * @param string $groups + * @param list<string> $groups */ public function __construct( - private $groups, + private array $groups, ) { } diff --git a/apps/dav/lib/Connector/Sabre/Directory.php b/apps/dav/lib/Connector/Sabre/Directory.php index a8b2438d4bc..a193417831c 100644 --- a/apps/dav/lib/Connector/Sabre/Directory.php +++ b/apps/dav/lib/Connector/Sabre/Directory.php @@ -363,10 +363,6 @@ class Directory extends Node implements \Sabre\DAV\ICollection, \Sabre\DAV\IQuot throw new BadRequest('Incompatible node types'); } - if (!$this->fileView) { - throw new ServiceUnavailable('filesystem not setup'); - } - $destinationPath = $this->getPath() . '/' . $targetName; diff --git a/apps/encryption/lib/Util.php b/apps/encryption/lib/Util.php index 26d04220733..20b2c0e5804 100644 --- a/apps/encryption/lib/Util.php +++ b/apps/encryption/lib/Util.php @@ -10,6 +10,7 @@ namespace OCA\Encryption; use OC\Files\Storage\Storage; use OC\Files\View; use OCA\Encryption\Crypto\Crypt; +use OCP\Files\Storage\IStorage; use OCP\IConfig; use OCP\IUser; use OCP\IUserManager; @@ -128,13 +129,7 @@ class Util { return $owner; } - /** - * get storage of path - * - * @param string $path - * @return Storage|null - */ - public function getStorage($path) { + public function getStorage(string $path): ?IStorage { return $this->files->getMount($path)->getStorage(); } diff --git a/apps/files_external/lib/Config/UserContext.php b/apps/files_external/lib/Config/UserContext.php index 55193c8ef24..6fe679c60b2 100644 --- a/apps/files_external/lib/Config/UserContext.php +++ b/apps/files_external/lib/Config/UserContext.php @@ -37,7 +37,7 @@ class UserContext { if ($this->userId !== null) { return $this->userId; } - if ($this->session && $this->session->getUser() !== null) { + if ($this->session->getUser() !== null) { return $this->session->getUser()->getUID(); } try { diff --git a/apps/user_ldap/lib/LDAPProvider.php b/apps/user_ldap/lib/LDAPProvider.php index c1aa9a5ac5c..d9750ae3fcf 100644 --- a/apps/user_ldap/lib/LDAPProvider.php +++ b/apps/user_ldap/lib/LDAPProvider.php @@ -118,8 +118,8 @@ class LDAPProvider implements ILDAPProvider, IDeletionFlagSupport { /** * Sanitize a DN received from the LDAP server. - * @param array $dn the DN in question - * @return array the sanitized DN + * @param array|string $dn the DN in question + * @return array|string the sanitized DN */ public function sanitizeDN($dn) { return $this->helper->sanitizeDN($dn); |