1. remove sizeof($filteredUsers) > 0 as condition
2. use count instead of sizeof. Latter is an alias to first one, practically we stick to count everywhere. Having it consistent helps with readability. 3. move whitespace so we have $groupUsers[] = $filteredUser; instead of $groupUsers []= $filteredUser;
This commit is contained in:
parent
1366133d2b
commit
7a14f94ae5
|
@ -225,11 +225,11 @@ class Manager extends PublicEmitter {
|
|||
$filteredUsers = $this->userManager->search($search, $searchLimit, $searchOffset);
|
||||
foreach($filteredUsers as $filteredUser) {
|
||||
if($group->inGroup($filteredUser)) {
|
||||
$groupUsers []= $filteredUser;
|
||||
$groupUsers[]= $filteredUser;
|
||||
}
|
||||
}
|
||||
$searchOffset += $searchLimit;
|
||||
} while(sizeof($groupUsers) < $searchLimit+$offset && sizeof($filteredUsers) > 0 && sizeof($filteredUsers) === $searchLimit);
|
||||
} while(count($groupUsers) < $searchLimit+$offset && count($filteredUsers) === $searchLimit);
|
||||
|
||||
if($limit === -1) {
|
||||
$groupUsers = array_slice($groupUsers, $offset);
|
||||
|
|
Loading…
Reference in New Issue