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

Bug: #3453

Closed
MashinaMashina opened this issue Aug 6, 2020 · 1 comment
Closed

Bug: #3453

MashinaMashina opened this issue Aug 6, 2020 · 1 comment
Labels
bug Verified issues on the current code behavior or pull requests that will fix them

Comments

@MashinaMashina
Copy link
Contributor

MashinaMashina commented Aug 6, 2020

Direction
Error:
Argument 1 passed to App\Models\MyModel::findAll() must be of the type int, null given, when we use $myModel->paginate() without params.

It error because $perPage default null and findAll can't got null in $limit. $perPage not required and contains bad value by default.

public function paginate(int $perPage = null
{
...
return $this->findAll($perPage, $offset);
}


public function findAll(int $limit = 0, int $offset = 0)
{
...
}

Break commit: 214e611#diff-384916434b0b7a276d4abf274120e2c3 Now we don't have line $perPage = $perPage ?? config('Pager')->perPage;

Now we have two ways:

  1. Remove = null from int $perPage = null, when $perPage will be required
  2. Set back int $perPage = 20
@MashinaMashina MashinaMashina added the bug Verified issues on the current code behavior or pull requests that will fix them label Aug 6, 2020
@MashinaMashina
Copy link
Contributor Author

I cant see newest code

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Verified issues on the current code behavior or pull requests that will fix them
Projects
None yet
Development

No branches or pull requests

1 participant