]> source.dussan.org Git - nextcloud-server.git/commitdiff
revert public interface back to the original types, just cast them before passing...
authorRobin Appelman <robin@icewind.nl>
Thu, 9 Feb 2023 10:46:46 +0000 (11:46 +0100)
committerRobin Appelman <robin@icewind.nl>
Thu, 11 May 2023 15:30:03 +0000 (17:30 +0200)
Signed-off-by: Robin Appelman <robin@icewind.nl>
lib/private/Group/Manager.php
lib/public/IGroupManager.php

index 4dde6152275accfc00dd2e5833c72142de87462e..0672e519e3668aa1d702b4aab56267de86daad39 100644 (file)
@@ -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);
                        }
                }
index 5c41d7e584277a7bb15259090b4d38979fdf8f79..a6655292398b001cbd57677bed32c6c54d60d19c 100644 (file)
@@ -96,12 +96,12 @@ interface IGroupManager {
 
        /**
         * @param string $search
-        * @param int $limit
-        * @param int $offset
+        * @param ?int $limit
+        * @param ?int $offset
         * @return \OCP\IGroup[]
         * @since 8.0.0
         */
-       public function search(string $search, int $limit = -1, int $offset = 0);
+       public function search(string $search, ?int $limit = null, ?int $offset = 0);
 
        /**
         * @param \OCP\IUser|null $user