Search code examples
phpstorm

How to change automatic variable generation in PhpStorm?


With PhpStorm, if you type function foo(MyClass $, it will propose myClass as the variable name.

But since I added a WordPress project (I accepted default settings for WordPress as proposed), it propose my_class instead.

I really would like to bring back the camel case naming by default, but I don't find where it is configured.

Is there an option for this? Or maybe a configuration file to edit?


Solution

  • In the settings (Ctrl+Alt+S), go to Editor > Code Style > PHP, then click the Other tab. At the bottom of the screen, you should see the Variable Naming Style section. Select camelCase.