slevomat / coding-standard

Slevomat Coding Standard for PHP_CodeSniffer provides many useful sniffs

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

UnusedVariableSniff detects anonymous class property as unused variable

mfb opened this issue · 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 I'm not able to reproduce it. Can you please prepare failing test?