aboutsummaryrefslogtreecommitdiffstats
path: root/lib/private/Group
diff options
context:
space:
mode:
authorRobin Appelman <robin@icewind.nl>2023-02-07 17:19:16 +0100
committerRobin Appelman <robin@icewind.nl>2023-05-11 17:30:01 +0200
commite4b9ecd8f2d5f98c2f67cf31c151909c81075653 (patch)
treeb5164354c8918288fdb74db81f05e1a54d2d2429 /lib/private/Group
parent9d2d3d482bce004d134dd87d7b37c3dfb6513412 (diff)
downloadnextcloud-server-e4b9ecd8f2d5f98c2f67cf31c151909c81075653.tar.gz
nextcloud-server-e4b9ecd8f2d5f98c2f67cf31c151909c81075653.zip
fix default values and type hints for GroupManager::search
ints really are ints Signed-off-by: Robin Appelman <robin@icewind.nl>
Diffstat (limited to 'lib/private/Group')
-rw-r--r--lib/private/Group/Manager.php4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/private/Group/Manager.php b/lib/private/Group/Manager.php
index b718afa5168..4dde6152275 100644
--- a/lib/private/Group/Manager.php
+++ b/lib/private/Group/Manager.php
@@ -240,7 +240,7 @@ class Manager extends PublicEmitter implements IGroupManager {
* @param int $offset
* @return \OC\Group\Group[]
*/
- public function search($search, $limit = null, $offset = null) {
+ public function search(string $search, int $limit = -1, int $offset = 0) {
$groups = [];
foreach ($this->backends as $backend) {
$groupIds = $backend->getGroups($search, $limit, $offset);
@@ -252,7 +252,7 @@ class Manager extends PublicEmitter implements IGroupManager {
$this->logger->debug('Group "' . $groupId . '" was returned by search but not found through direct access', ['app' => 'core']);
}
}
- if (!is_null($limit) and $limit <= 0) {
+ if ($limit === 0) {
return array_values($groups);
}
}