PHP Code Sniffer and PHP Mess Detector are the proven tools for ensuring that your code is clean, consistent, and conforming to the chosen coding standards.

In PhpStorm .2, we’ve setting up of these tools to the point that almost no is actually required. The paths to Code Sniffer and Mess Detector are now automatically detected from composer.json – in the same way as it happens for PHPUnit or Behat.

To set up these tools in a project, you only need declare them as dependencies in composer.json and run Install:

phpcs_phpmd_setup

To start inspecting code, locate and the corresponding inspections under Preferences | Editor | Inspections | PHP | Quality Tools.

For PHPCS, though, you can alternatively provide the desired ruleset in the scripts section of composer.json. PhpStorm in this case will enable the corresponding inspection and select the provided coding standard for it automatically:

phpcs_inspection_setup

Similar functionality is coming for PHPMD, too, of course. Stay tuned!

Your JetBrains PhpStorm Team
The Drive to Develop

This entry was posted in Cool Feature, Newsletter and tagged , , . Bookmark the permalink.



Source link
thanks you RSS link
( https://blog.jetbrains.com/phpstorm/2018/08/simplified--and--setup/)

LEAVE A REPLY

Please enter your comment!
Please enter your name here