2

When used as property of an object, for example User::id or File::id, name "id" makes perfect sense in my opinion. However PHP Mess Detector complains:

Avoid variables with short names like $id.

I understand, that $id as a local variable is not descriptive enough, but class or object name should provide sufficient context.

If there's a reason why "id" is too short, what's the proper way of naming object identifier variable and why?

Piotr Maj
  • 63
  • 6

0 Answers0