Search code examples
phpstormphpcodesniffer

Change coding standard for CodeSniffer in PhpStorm


I've installed the CodeSniffer and want to use it with PhpStorm.

I want to use the PSR2 coding standard to check for my source code, but it looks like the IDE checks with another standard. I can't find an option for changing the standards to define an extra parameter.


Solution

  • You can change the coding standard in Preferences->Inspections->PHP->PHP Code Sniffer validation. There is a selectbox with predefined standards like PEAR, PSR1, PSR2 and you can also define your own.

    codesniffer option in phpstorm