aboutsummaryrefslogtreecommitdiffstats
path: root/lib
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
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')
-rw-r--r--lib/private/Group/Manager.php4
-rw-r--r--lib/public/IGroupManager.php2
2 files changed, 3 insertions, 3 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);
}
}
diff --git a/lib/public/IGroupManager.php b/lib/public/IGroupManager.php
index 2e2685eeeb4..5c41d7e5842 100644
--- a/lib/public/IGroupManager.php
+++ b/lib/public/IGroupManager.php
@@ -101,7 +101,7 @@ interface IGroupManager {
* @return \OCP\IGroup[]
* @since 8.0.0
*/
- public function search($search, $limit = null, $offset = null);
+ public function search(string $search, int $limit = -1, int $offset = 0);
/**
* @param \OCP\IUser|null $user