From fc4212d6457e96aa8e2827a5a4780d606310b51e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=B4me=20Chilliet?= Date: Thu, 22 Dec 2022 12:16:08 +0100 Subject: [PATCH] Make code clearer and bump @ deprecated annotations MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Côme Chilliet --- lib/private/Group/Group.php | 10 ++++++---- lib/private/User/Manager.php | 2 +- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/lib/private/Group/Group.php b/lib/private/Group/Group.php index f0092f27c87aa..16cefb0360ced 100644 --- a/lib/private/Group/Group.php +++ b/lib/private/Group/Group.php @@ -253,9 +253,11 @@ public function searchUsers(string $search, ?int $limit = null, ?int $offset = n } else { $userIds = $backend->usersInGroup($this->gid, $search, $limit ?? -1, $offset ?? 0); $userManager = \OCP\Server::get(IUserManager::class); - $users = array_merge($users, array_map(function (string $userId) use ($userManager): IUser { - return new LazyUser($userId, $userManager); - }, $userIds)); + $userObjects = array_map( + fn (string $userId): IUser => new LazyUser($userId, $userManager), + $userIds + ); + $users = array_merge($users, $userObjects); } if (!is_null($limit) and $limit <= 0) { return $users; @@ -312,7 +314,7 @@ public function countDisabled() { * @param int $limit * @param int $offset * @return IUser[] - * @deprecated 25.0.0 Use searchUsers instead (same implementation) + * @deprecated 26.0.0 Use searchUsers instead (same implementation) */ public function searchDisplayName($search, $limit = null, $offset = null) { return $this->searchUsers($search, $limit, $offset); diff --git a/lib/private/User/Manager.php b/lib/private/User/Manager.php index 1b011878e0efe..fa95a7c719fda 100644 --- a/lib/private/User/Manager.php +++ b/lib/private/User/Manager.php @@ -298,7 +298,7 @@ public function checkPasswordNoLogging($loginName, $password) { * @param int $limit * @param int $offset * @return IUser[] - * @deprecated since 25.0.0, use searchDisplayName instead + * @deprecated since 26.0.0, use searchDisplayName instead */ public function search($pattern, $limit = null, $offset = null) { $users = [];