Make code clearer and bump @ deprecated annotations

Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
pull/32866/head
Côme Chilliet 2 years ago
parent a4c599c1c9
commit 3c2b126eba
No known key found for this signature in database
GPG Key ID: A3E2F658B28C760A
  1. 10
      lib/private/Group/Group.php
  2. 2
      lib/private/User/Manager.php

@ -255,9 +255,11 @@ class Group implements IGroup {
} 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;
@ -314,7 +316,7 @@ class Group implements IGroup {
* @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);

@ -299,7 +299,7 @@ class Manager extends PublicEmitter implements IUserManager {
* @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 = [];

Loading…
Cancel
Save