phpphpcs

How to enforce snake_case for properties with PHPCS?


I am trying to find rule which will enforce ONLY properties to be in $snake_case

I have this for CamelCase:

<rule ref="Squiz.NamingConventions.ValidVariableName.NotCamelCaps"/>

Is there any full list of these rules and what they do? Cannot find them. Thanks!


Solution

  • I ended up including Wordpress Coding Standard and adding this rule:

    <rule ref="WordPress.NamingConventions.ValidVariableName.VariableNotSnakeCase"/>