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

newQuery() is not static #846

Closed
Jamesking56 opened this issue Nov 16, 2019 · 6 comments
Closed

newQuery() is not static #846

Jamesking56 opened this issue Nov 16, 2019 · 6 comments
Labels

Comments

@Jamesking56
Copy link

php artisan ide-helper:models --write adds query() and newQuery() as static methods in the PHPDoc of the model class.

query() is static, but newQuery() isn't. However, ide-helper marks them both as static.

This normally wouldn't matter too much, until you use strict PHPStan which states that any usages of newQuery() should be static. So $model->newQuery() fails PHPStan due to the false PHPDoc added by ide-helper.

I hope that makes sense, but basically newQuery() shouldn't be marked as static.

@jpickwell
Copy link

The Method class constructor treats all methods as static.

@Jamesking56
Copy link
Author

Yes but it shouldn't do, since some methods aren't static.

@mfn
Copy link
Collaborator

mfn commented Jan 6, 2020

I'd say: PRs welcome 😄

@stale
Copy link

stale bot commented Jul 29, 2020

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.
If this issue is still present on the latest version of this library on supported Laravel versions, please let us know by replying to this issue so we can investigate further.
Thank you for your contribution! Apologies for any delayed response on our side.

@stale stale bot added the stale label Jul 29, 2020
@barryvdh
Copy link
Owner

Closed in favor of #872

@mfn
Copy link
Collaborator

mfn commented Jul 31, 2020

@barryvdh FTR this is closed in favour of a PR ( #872 ) but there's also a competing PR #897 and neither is merged so the reported issue per se isn't solved yet.

I don't want to override your closing but I think as long as it's not "done" we should keep it open?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants