Skip to content

Commit

Permalink
Make code clearer and bump @ deprecated annotations
Browse files Browse the repository at this point in the history
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
  • Loading branch information
come-nc committed Dec 22, 2022
1 parent 8385eba commit fc4212d
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
10 changes: 6 additions & 4 deletions lib/private/Group/Group.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion lib/private/User/Manager.php
Original file line number Diff line number Diff line change
Expand Up @@ -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 = [];
Expand Down

0 comments on commit fc4212d

Please sign in to comment.