From 3fe42b84afcb74f80b27a4fe0e679c909248496f Mon Sep 17 00:00:00 2001 From: Steve Boyd Date: Mon, 27 Nov 2023 18:18:01 +1300 Subject: [PATCH] API Use correct param types --- src/ORM/Search/SearchContext.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/ORM/Search/SearchContext.php b/src/ORM/Search/SearchContext.php index 978ba3677e0..70e97d9e3ae 100644 --- a/src/ORM/Search/SearchContext.php +++ b/src/ORM/Search/SearchContext.php @@ -130,17 +130,17 @@ protected function applyBaseTableFields() * for example "Comments__Name" instead of the filter name "Comments.Name". * @param array|bool|string $sort Database column to sort on. * Falls back to {@link DataObject::$default_sort} if not provided. - * @param array|null|string $limit + * @param int|array|null $limit * @param DataList $existingQuery * @return DataList * @throws Exception */ public function getQuery($searchParams, $sort = false, $limit = false, $existingQuery = null) { - if ((count(func_get_args()) >= 3) && (!in_array(gettype($limit), ['array', 'NULL', 'string']))) { + if ((count(func_get_args()) >= 3) && (!in_array(gettype($limit), ['integer', 'array', 'NULL']))) { Deprecation::notice( '5.1.0', - '$limit should be type of array|string|null' + '$limit should be type of int|array|null' ); $limit = null; } @@ -172,7 +172,7 @@ private function search(DataList $query): DataList * Prepare the query to begin searching * * @param array|bool|string $sort Database column to sort on. - * @param array|null|string $limit + * @param int|array|null $limit */ private function prepareQuery($sort, $limit, ?DataList $existingQuery): DataList {