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

Support Query Scope classes #207

Open
caugner opened this issue Nov 26, 2021 · 0 comments
Open

Support Query Scope classes #207

caugner opened this issue Nov 26, 2021 · 0 comments
Labels
enhancement New feature or request

Comments

@caugner
Copy link
Contributor

caugner commented Nov 26, 2021

Is your feature request related to a problem? Please describe.

Query Scope classes can be created using make:scope as an alternative to creating "local" scopes inside the Model class directly. The Scope interface has an apply() method that takes two parameters, Builder $builder and Model $model and these can not be overwritten in a Scope implementation, as this causes Psalm to emit a MoreSpecifciImplementedParamType error.

Describe the solution you'd like
The Scope interface should be extended with a @template TModel of Model, so that the apply() parameters can be typed as @param Builder<TModel> $builder and @param TModel $model respectively.

Describe alternatives you've considered
(None.)

Additional context

@caugner caugner added the enhancement New feature or request label Nov 26, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants