From a22e83b146b003cfed9eaad891e601412f11ab0a Mon Sep 17 00:00:00 2001 From: Carl Schwan Date: Thu, 24 Sep 2026 11:33:44 +0200 Subject: [PATCH] refactor: Port away from NoUserException Signed-off-by: Carl Schwan --- lib/Service/SearchService.php | 4 ++-- phpstan.neon | 1 - tests/stubs/oc_user_nouserexception.stub | 7 ------- 3 files changed, 2 insertions(+), 10 deletions(-) delete mode 100644 tests/stubs/oc_user_nouserexception.stub diff --git a/lib/Service/SearchService.php b/lib/Service/SearchService.php index 42bd7c9f..92afbda6 100644 --- a/lib/Service/SearchService.php +++ b/lib/Service/SearchService.php @@ -11,7 +11,6 @@ use Exception; use OC\FullTextSearch\Model\DocumentAccess; -use OC\User\NoUserException; use OCA\Circles\CirclesManager; use OCA\Circles\Model\Circle; use OCA\FullTextSearch\Exceptions\EmptySearchException; @@ -27,6 +26,7 @@ use OCP\IGroupManager; use OCP\IUser; use OCP\IUserManager; +use OCP\User\Exceptions\UserNotFoundException; class SearchService implements ISearchService { @@ -65,7 +65,7 @@ public function search(string $userId, ISearchRequest $searchRequest): array { $user = $this->userManager->get($userId); if ($user === null) { - throw new NoUserException('User does not exist'); + throw new UserNotFoundException('User does not exist'); } /** @var SearchRequest $searchRequest */ diff --git a/phpstan.neon b/phpstan.neon index b894020c..b21db317 100644 --- a/phpstan.neon +++ b/phpstan.neon @@ -23,7 +23,6 @@ parameters: - tests/stubs/oc_fulltextsearch_mode_searchtemplate.stub - tests/stubs/oc_core_command_base.php - tests/stubs/oc_core_interruptedexception.stub - - tests/stubs/oc_user_nouserexception.stub - tests/stubs/oc_forbiddenexception.stub - tests/stubs/oc_db_connectionadapter.php - tests/stubs/oca_circles_circlesmanager.php diff --git a/tests/stubs/oc_user_nouserexception.stub b/tests/stubs/oc_user_nouserexception.stub deleted file mode 100644 index 5c690576..00000000 --- a/tests/stubs/oc_user_nouserexception.stub +++ /dev/null @@ -1,7 +0,0 @@ -