-
-
Notifications
You must be signed in to change notification settings - Fork 146
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
Update PHPStan #251
Update PHPStan #251
Conversation
e2fbf51
to
addea81
Compare
@ondrejmirtes Thank you for looking into this and suggesting improvements for the work done in #247. Briefly eyeballed your changes and noticed there are still a couple of |
The code in question: assertType('React\Promise\PromiseInterface<*NEVER*>', resolve(true)->then(function (bool $value): never {
throw new \RuntimeException();
})); There are two "never" types in PHPStan:
For anonymous functions, PHPStan can infer always-throwing function even without a native It will be released at the earliest convenience. |
@ondrejmirtes Thanks for the insights and the update in PHPStan! 👍 Your explanation sounds reasonable. It's my understanding this is more of a maintenance topic that doesn't currently have high priority, so we probably want to keep this open until the next PHPStan is released and we can update this consistently in a single shot. Thank you, will keep an eye on this! |
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.
Thanks @ondrejmirtes for filing this, had a quick row with this while working on the initial templates implementation. Liking these changes 👍 .
addea81
to
91cad0e
Compare
Just update PHPStan version and all |
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.
👍
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.
@ondrejmirtes Thanks for the update, changes LGTM!
PHPStan 1.10.31 introduces NonAcceptingNeverType (phpstan/phpstan#6485, phpstan/phpstan#9133) that ensures that a literal
never
type in the code does not accept any other type exceptnever
.As a side-effect of this change a type description or an error message about this changed from
*NEVER*
tonever
. I'm sending an update to your test suite because of this :)