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

QueryFilter::make() should return static instead of self #22

Open
kblais opened this issue Oct 20, 2023 · 0 comments
Open

QueryFilter::make() should return static instead of self #22

kblais opened this issue Oct 20, 2023 · 0 comments
Assignees

Comments

@kblais
Copy link
Owner

kblais commented Oct 20, 2023

Static analysis throws an error with this code :

class JobFilter extends QueryFilter
{
    ...
}

class JobController
{
    protected JobFilter $filter;

    public function index(Request $request) {
        $this->jobFilter = JobFilter::make(['foo' => $request->input('foo')]);
    }
}

Error from PHPStan : "Property JobController::$filter (JobFilter) does not accept Kblais\QueryFilter\QueryFilter"

@kblais kblais self-assigned this Oct 20, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant