diff --git a/apps/dav/lib/Avatars/AvatarNode.php b/apps/dav/lib/Avatars/AvatarNode.php index 98ee67d3c781e..b3a605fbb02be 100644 --- a/apps/dav/lib/Avatars/AvatarNode.php +++ b/apps/dav/lib/Avatars/AvatarNode.php @@ -69,10 +69,6 @@ public function getETag() { } 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 568907813af7d..07aeecb3fa255 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 $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 a8b2438d4bcde..a193417831cd4 100644 --- a/apps/dav/lib/Connector/Sabre/Directory.php +++ b/apps/dav/lib/Connector/Sabre/Directory.php @@ -363,10 +363,6 @@ public function moveInto($targetName, $fullSourcePath, INode $sourceNode) { 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 26d04220733cf..20b2c0e580451 100644 --- a/apps/encryption/lib/Util.php +++ b/apps/encryption/lib/Util.php @@ -10,6 +10,7 @@ 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 @@ public function getOwner($path) { 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 55193c8ef2439..6fe679c60b21a 100644 --- a/apps/files_external/lib/Config/UserContext.php +++ b/apps/files_external/lib/Config/UserContext.php @@ -37,7 +37,7 @@ protected function getUserId(): ?string { 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 c1aa9a5ac5cde..d9750ae3fcf3d 100644 --- a/apps/user_ldap/lib/LDAPProvider.php +++ b/apps/user_ldap/lib/LDAPProvider.php @@ -118,8 +118,8 @@ public function DNasBaseParameter($dn) { /** * 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 da9e628dd4d83..fbc5a4ac4fc6a 100644 --- a/build/psalm-baseline.xml +++ b/build/psalm-baseline.xml @@ -682,12 +682,6 @@ - - - files->getMount($path)->getStorage()]]> - - - diff --git a/lib/public/LDAP/ILDAPProvider.php b/lib/public/LDAP/ILDAPProvider.php index 584b554aa8153..22f4b872adcb1 100644 --- a/lib/public/LDAP/ILDAPProvider.php +++ b/lib/public/LDAP/ILDAPProvider.php @@ -46,8 +46,8 @@ public function DNasBaseParameter($dn); /** * 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);