From 13b06ba4e25c4673f782bdf0bb356a07bfac0f7d Mon Sep 17 00:00:00 2001 From: Robin Appelman Date: Thu, 9 Feb 2023 11:46:46 +0100 Subject: revert public interface back to the original types, just cast them before passing the nulls to the backends Signed-off-by: Robin Appelman --- lib/private/Group/Manager.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'lib/private') diff --git a/lib/private/Group/Manager.php b/lib/private/Group/Manager.php index 4dde6152275..0672e519e36 100644 --- a/lib/private/Group/Manager.php +++ b/lib/private/Group/Manager.php @@ -236,14 +236,14 @@ class Manager extends PublicEmitter implements IGroupManager { /** * @param string $search - * @param int $limit - * @param int $offset + * @param ?int $limit + * @param ?int $offset * @return \OC\Group\Group[] */ - public function search(string $search, int $limit = -1, int $offset = 0) { + public function search(string $search, ?int $limit = null, ?int $offset = 0) { $groups = []; foreach ($this->backends as $backend) { - $groupIds = $backend->getGroups($search, $limit, $offset); + $groupIds = $backend->getGroups($search, $limit ?? -1, $offset ?? 0); foreach ($groupIds as $groupId) { $aGroup = $this->get($groupId); if ($aGroup instanceof IGroup) { @@ -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 ($limit === 0) { + if (!is_null($limit) and $limit <= 0) { return array_values($groups); } } -- cgit v1.2.3