Skip to content

Commit

Permalink
API Use correct param types
Browse files Browse the repository at this point in the history
  • Loading branch information
emteknetnz committed Dec 8, 2023
1 parent 809f9e7 commit 3fe42b8
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/ORM/Search/SearchContext.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down Expand Up @@ -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
{
Expand Down

0 comments on commit 3fe42b8

Please sign in to comment.