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

UnusedVariableSniff detects anonymous class property as unused variable #1636

Open
mfb opened this issue Nov 7, 2023 · 1 comment
Open

Comments

@mfb
Copy link

mfb commented Nov 7, 2023

Here $bar is considered an unused variable:

$foo = new class () {
  public array $bar = [];
};

This also happens if I use the property in a method, by the way :)

@kukulich
Copy link
Contributor

kukulich commented Mar 9, 2024

@mfb I'm not able to reproduce it. Can you please prepare failing test?

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

2 participants