Skip to content

Commit 5871ca0

Browse files
committed
fix default values and type hints for GroupManager::search
ints really are ints Signed-off-by: Robin Appelman <robin@icewind.nl>
1 parent 82498bc commit 5871ca0

2 files changed

Lines changed: 3 additions & 3 deletions

File tree

lib/private/Group/Manager.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -240,7 +240,7 @@ public function createGroup($gid) {
240240
* @param int $offset
241241
* @return \OC\Group\Group[]
242242
*/
243-
public function search($search, $limit = null, $offset = null) {
243+
public function search(string $search, int $limit = -1, int $offset = 0) {
244244
$groups = [];
245245
foreach ($this->backends as $backend) {
246246
$groupIds = $backend->getGroups($search, $limit, $offset);
@@ -252,7 +252,7 @@ public function search($search, $limit = null, $offset = null) {
252252
$this->logger->debug('Group "' . $groupId . '" was returned by search but not found through direct access', ['app' => 'core']);
253253
}
254254
}
255-
if (!is_null($limit) and $limit <= 0) {
255+
if ($limit === 0) {
256256
return array_values($groups);
257257
}
258258
}

lib/public/IGroupManager.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ public function createGroup($gid);
101101
* @return \OCP\IGroup[]
102102
* @since 8.0.0
103103
*/
104-
public function search($search, $limit = null, $offset = null);
104+
public function search(string $search, int $limit = -1, int $offset = 0);
105105

106106
/**
107107
* @param \OCP\IUser|null $user

0 commit comments

Comments
 (0)