From 67d20f263f0ebd63f32e2ccca1975ba5718c6b0a Mon Sep 17 00:00:00 2001 From: greta Date: Mon, 15 Jun 2026 12:35:48 +0200 Subject: [PATCH] fix(psalm): adapt to updated OCP dev-master return types - IRequest::getUploadedFile now declared as array|null; use inline isset() so psalm can narrow the type correctly - IUser::getUID now declared as non-nullable string; remove redundant null guard in Provisioning::buildUserEmail Assisted-by: ClaudeCode:claude-sonnet-4-6 Signed-off-by: greta --- lib/Controller/MessageApiController.php | 3 +-- lib/Db/Provisioning.php | 4 +--- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/lib/Controller/MessageApiController.php b/lib/Controller/MessageApiController.php index 52882b81a4..b30d6ab965 100644 --- a/lib/Controller/MessageApiController.php +++ b/lib/Controller/MessageApiController.php @@ -455,8 +455,7 @@ public function getAttachment(int $id, string $attachmentId): DataResponse { */ private function handleAttachments(): array { $fileAttachments = $this->request->getUploadedFile('attachments'); - $hasAttachments = isset($fileAttachments['name']); - if (!$hasAttachments) { + if (!isset($fileAttachments['name'])) { return []; } diff --git a/lib/Db/Provisioning.php b/lib/Db/Provisioning.php index 8d85c6d153..31e0a22081 100644 --- a/lib/Db/Provisioning.php +++ b/lib/Db/Provisioning.php @@ -145,9 +145,7 @@ public function buildEmail(IUser $user) { * @return string */ private function buildUserEmail(string $original, IUser $user) { - if ($user->getUID() !== null) { - $original = str_replace('%USERID%', $user->getUID(), $original); - } + $original = str_replace('%USERID%', $user->getUID(), $original); if ($user->getEMailAddress() !== null) { $original = str_replace('%EMAIL%', $user->getEMailAddress(), $original); }