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:
voxsim 2014-09-18 17:50:19 +02:00
parent 1366133d2b
commit 7a14f94ae5
1 changed files with 2 additions and 2 deletions

View File

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