aik099 / CodingStandard

The PHP_CodeSniffer coding standard I'm using on all of my projects
BSD 3-Clause "New" or "Revised" License
5 stars 2 forks source link

ValidVariableName assert only declaration #59

Closed aik099 closed 9 years ago

aik099 commented 9 years ago

Currently ValidaVariableName sniff asserts both variable declaration and usage. This will show 5 warnings for cases when variable is declared once and used 4 times.

Instead we should only assert variable declaration.

aik099 commented 9 years ago

Additionally there seems to be a bug in detection of class/non-class variables. Currently ' .... {$something} ...' is triggering an error.

We only should consider variable a class variable, when one of following happens: