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

@psalm-suppress don't work for MissingClassConstType issue #10933

Closed
vjik opened this issue May 2, 2024 · 5 comments · Fixed by #10953
Closed

@psalm-suppress don't work for MissingClassConstType issue #10933

vjik opened this issue May 2, 2024 · 5 comments · Fixed by #10953

Comments

@vjik
Copy link
Contributor

vjik commented May 2, 2024

No description provided.

Copy link

Hey @vjik, can you reproduce the issue on https://psalm.dev? These will be used as phpunit tests when implementing the feature or fixing this bug.

@ThomasLandauer
Copy link
Contributor

I suggested to suppress MissingClassConstType for final classes: #10951

@jack-worman
Copy link
Contributor

jack-worman commented May 4, 2024

I don't understand why you would add @psalm-suppress instead of just adding the type.

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
@vjik
Copy link
Contributor Author

vjik commented May 5, 2024

I don't understand why you would add @psalm-suppress instead of just adding the type.

We use psalm for library that support previous PHP versions (8.1, 8.2).

@weirdan
Copy link
Collaborator

weirdan commented May 5, 2024

We use psalm for library that support previous PHP versions (8.1, 8.2).

what @jack-worman was alluding to is that since you're adding a docblock anyway you could have added, e.g., /** @var int */ instead and get better type inference, even before 8.3.

Nevertheless, @psalm-suppress should work anyway.

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

Successfully merging a pull request may close this issue.

4 participants