-
Notifications
You must be signed in to change notification settings - Fork 667
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
Suppress MissingClassConstType
if the class is final
#10951
Comments
Hey @ThomasLandauer, can you reproduce the issue on https://psalm.dev? These will be used as phpunit tests when implementing the feature or fixing this bug. |
jack-worman
added a commit
to jack-worman/psalm
that referenced
this issue
May 4, 2024
jack-worman
added a commit
to jack-worman/psalm
that referenced
this issue
May 4, 2024
jack-worman
added a commit
to jack-worman/psalm
that referenced
this issue
May 4, 2024
jack-worman
added a commit
to jack-worman/psalm
that referenced
this issue
May 4, 2024
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
MissingClassConstType
was added in #10828 by @jack-wormanThe RFC kinda mentions that typed constants are only useful with regard to child classes - see https://wiki.php.net/rfc/typed_class_constants
So when a class is
final
(=best practice for most classes today), there's no need to to type something likeconst foo = 5;
, since it's obvious that it's anint
.So I'm suggesting to restrict
MissingClassConstType
to cases where neither the class nor theconst
itself arefinal
.The text was updated successfully, but these errors were encountered: