Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

API Use correct param types #11073

Merged
merged 1 commit into from
Dec 11, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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