-
-
Couldn't load subscription status.
- Fork 4.6k
Annotate how query works #22887
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
Annotate how query works #22887
Conversation
https://github.com/phan/phan/wiki/Generic-Types#indicating-a-method-creates-an-instance-of-the-passed-in-class-name Signed-off-by: Daniel Kesselberg <mail@danielkesselberg.de>
|
Yep. Should also work with Psalm and hopefully PHPStorm sometime. |
Does work, but now Psalm stumbles over the non-class keys. :/ Anyways - something that we can look into with this separate PR. |
Things that are good to clean up :) |
|
Ah. At some places we are still using ->query('UserStatus'). Psalm is unable to resolve those aliases and fails. |
Exactly - but this is something we can tackle in 21. |
|
🤖 beep boop beep 🤖 Here are the logs for the failed build: Status of 33109: failuremariadb10.1-php7.2Show full logmysql8.0-php7.2Show full logacceptance-app-theming
Show full logacceptance-header
Show full log |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🙈 sure
|
|
||
| /** | ||
| * @template T | ||
| * @param class-string<T> $id |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what if you use class-string<T>|string for now? would that work with our named aliases?
|
Implemented via #23377 |
https://github.com/phan/phan/wiki/Generic-Types#indicating-a-method-creates-an-instance-of-the-passed-in-class-name
Extracted from #18680 by @kesselb