You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
An asterisk * for constant enumerations means all constants. When a function doesn't return all constants matched by the asterisk, PHPStan shows Method ... never returns string so it can be removed from the return typehint.. This looks really unclear. If the string word could be replaced with a specific list of constants that are not returned, it would be much better.
@@ @@-22: Method Test::throwsPhpStanError() never returns string so it can be removed from the return typehint.+22: Method Test::throwsPhpStanError() never returns 'open' so it can be removed from the return typehint.
Full report
Line
Error
22
Method Test::throwsPhpStanError() never returns 'open' so it can be removed from the return typehint.
Bug report
An asterisk
*
for constant enumerations means all constants. When a function doesn't return all constants matched by the asterisk, PHPStan showsMethod ... never returns string so it can be removed from the return typehint.
. This looks really unclear. If thestring
word could be replaced with a specific list of constants that are not returned, it would be much better.Code snippet that reproduces the problem
https://phpstan.org/r/31821eb7-2751-4a04-909f-dd8262fbfe0f
Expected output
Method Test::throwsPhpStanError() never returns StatusEnum::STATUS_OPEN so it can be removed from the return typehint.
The text was updated successfully, but these errors were encountered: