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

Trait in enum with abstract methods #11592

Closed
leander-hass opened this issue Aug 30, 2024 · 2 comments
Closed

Trait in enum with abstract methods #11592

leander-hass opened this issue Aug 30, 2024 · 2 comments
Labels

Comments

@leander-hass
Copy link

Bug report

Hello, I want to extend Enums using a trait. This trait accesses enum-specific methods, like cases(). To prevent linter-errors I have declared these methods as abstract in my trait. As they are defined by PHP in enums, this works without error. But now phpstan complains that the method is not defined.

Code snippet that reproduces the problem

https://phpstan.org/r/ed01077e-f659-4cfb-864d-e8b9efa1f996

Expected output

The error is detected incorrectly.

Did PHPStan help you today? Did it make you happy in any way?

PHPStan really helps me write better code and find bugs. It's such a pleasure to work with it.

@ondrejmirtes
Copy link
Member

Fixed phpstan/phpstan-src@c50b71f

Copy link

github-actions bot commented Oct 5, 2024

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Oct 5, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

2 participants