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
PHP 8.1 Enums static methods support #1073
Comments
I agree it's not ideal, our doc says:
A.K.A. Named constructors, So at the moment it's on user to manually suppress those accesses that are valid. It's far from being straightforward but when those methods are correctly type with For |
Would such methods not piratically always be strongly typed unless the class name is gotten dynamically as a string?
I have somehow forgotten, but are we not able to read types from PHPDoc ( |
Yes we can just consider
It's significantly less efficient to parse annotations (and the multiple forms: |
Arh i was thinking we could do it specifically for the enum class |
We can, it's a quick-win, and the same way we can also include other PHP native static constructors such as |
Current Behavior
Any of
trigger message
Avoid using static access to class
Expected Behavior
No message, because this methods by design: https://www.php.net/manual/en/class.backedenum.php
Steps To Reproduce:
Try to use any method of https://www.php.net/manual/en/class.backedenum.php.
Please fix this behavior
The text was updated successfully, but these errors were encountered: