Is "$id" class property name too short?

272 Views Asked by At

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?

0

There are 0 best solutions below