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

Opinion on removing name dependency from Class__::isAnonymous() #1018

Open
tscni opened this issue Aug 22, 2024 · 0 comments
Open

Opinion on removing name dependency from Class__::isAnonymous() #1018

tscni opened this issue Aug 22, 2024 · 0 comments

Comments

@tscni
Copy link

tscni commented Aug 22, 2024

Hi

This has been brought up before partially (#554).
PHPStan gives anonymous class nodes a name to generalize behavior between anonymous and regular classes.
As pointed out before, this does of course break PhpParser\Node\Stmt\Class_::isAnonymous().

We can resolve this by extending Class_ and overriding the method to always return true. (as implemented here phpstan/phpstan-src#3343), but it feels a bit cumbersome to do.

So here I'm mainly wondering what your opinion is on changing Class_::isAnoynmous() to use e.g. a new "is anonymous" flag or similar.

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

No branches or pull requests

1 participant