From 17744f8590513e6a1d0e2a19a101b5f6e7332fcc Mon Sep 17 00:00:00 2001 From: Joas Schilling Date: Wed, 17 Apr 2024 15:30:43 +0200 Subject: [PATCH] fix(activity): Remove unneeded exception (types are enforced) Signed-off-by: Joas Schilling --- lib/private/Activity/Manager.php | 4 ---- lib/public/Activity/IManager.php | 1 - 2 files changed, 5 deletions(-) diff --git a/lib/private/Activity/Manager.php b/lib/private/Activity/Manager.php index 7f95771294a..6bf042efe1a 100644 --- a/lib/private/Activity/Manager.php +++ b/lib/private/Activity/Manager.php @@ -334,12 +334,8 @@ class Manager implements IManager { * Set the user we need to use * * @param string|null $currentUserId - * @throws \UnexpectedValueException If the user is invalid */ public function setCurrentUserId(?string $currentUserId = null): void { - if (!is_string($currentUserId) && $currentUserId !== null) { - throw new \UnexpectedValueException('The given current user is invalid'); - } $this->currentUserId = $currentUserId; } diff --git a/lib/public/Activity/IManager.php b/lib/public/Activity/IManager.php index 3d364874e5e..06b2ef27259 100644 --- a/lib/public/Activity/IManager.php +++ b/lib/public/Activity/IManager.php @@ -165,7 +165,6 @@ interface IManager { * Set the user we need to use * * @param string|null $currentUserId - * @throws \UnexpectedValueException If the user is invalid * @since 9.0.1 */ public function setCurrentUserId(?string $currentUserId = null): void;