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;
$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);