coding-standard icon indicating copy to clipboard operation
coding-standard copied to clipboard

UnusedVariableSniff detects anonymous class property as unused variable

Open mfb opened this issue 1 year ago • 1 comments

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 :)

mfb avatar Nov 07 '23 23:11 mfb

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

kukulich avatar Mar 09 '24 14:03 kukulich