aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--apps/dav/lib/Avatars/AvatarNode.php6
-rw-r--r--apps/dav/lib/CardDAV/Xml/Groups.php4
-rw-r--r--apps/dav/lib/Connector/Sabre/Directory.php4
-rw-r--r--apps/encryption/lib/Util.php9
-rw-r--r--apps/files_external/lib/Config/UserContext.php2
-rw-r--r--apps/user_ldap/lib/LDAPProvider.php4
-rw-r--r--build/psalm-baseline.xml6
-rw-r--r--lib/public/LDAP/ILDAPProvider.php4
8 files changed, 10 insertions, 29 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);
diff --git a/build/psalm-baseline.xml b/build/psalm-baseline.xml
index da9e628dd4d..fbc5a4ac4fc 100644
--- a/build/psalm-baseline.xml
+++ b/build/psalm-baseline.xml
@@ -682,12 +682,6 @@
<code><![CDATA[new PrivateKeyMissingException('please try to log-out and log-in again', 0)]]></code>
</TooManyArguments>
</file>
- <file src="apps/encryption/lib/Util.php">
- <LessSpecificReturnStatement>
- <code><![CDATA[$this->files->getMount($path)->getStorage()]]></code>
- </LessSpecificReturnStatement>
- <MoreSpecificReturnType/>
- </file>
<file src="apps/federatedfilesharing/lib/Controller/RequestHandlerController.php">
<InvalidArgument>
<code><![CDATA[$id]]></code>
diff --git a/lib/public/LDAP/ILDAPProvider.php b/lib/public/LDAP/ILDAPProvider.php
index 584b554aa81..22f4b872adc 100644
--- a/lib/public/LDAP/ILDAPProvider.php
+++ b/lib/public/LDAP/ILDAPProvider.php
@@ -46,8 +46,8 @@ interface ILDAPProvider {
/**
* 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
* @since 11.0.0
*/
public function sanitizeDN($dn);