Code Quality Tools Support Enhancements

With PhpStorm 2018.3, you’ve got unified support and a straightforward setup process for several quality tools including PHPCS, PHPMD, and PHP CS Fixer. It seems natural to keep the corresponding settings in a single place, too. This is why we’ve streamlined them in the latest release.

To configure a quality tool, or all of them, you can now navigate to Settings / Preferences | Language & Frameworks | PHP | Quality Tools:

quality_tools_set_up-1

Detecting PHPCS coding standards

When you develop with one of the major Frameworks or CMSs, you can rely on the corresponding coding standard to ensure code quality and style compliance.

In PhpStorm 2018.3, if you have both PHPCS and one of the Standards added to the required-dev section of your composer.json, then the corresponding inspection will be turned on automatically as soon as your run Install.

quality-tools-phpcs-doctrine-composer

Currently, the following standards will be detected automatically:

Let us know what other standards you’d like added: simply leave a comment in the dedicated issue in our tracker.

Stay tuned for more updates!

Your JetBrains PhpStorm Team
The Drive to Develop

This entry was posted in Cool Feature and tagged , . Bookmark the permalink.
  • http://gcore.cz/ WarfaceZ

    I’d like add https://github.com/nette/coding-standard (Nette Coding standard) and https://github.com/ninjify/qa

    Thanks

  • http://tech.gtaero.net/ Navarr Barnier

    Magento/marketplace-eqp though I think they have two in that repo.

    They do have two in that repo, the same bet though is probably m2 since Magento 1 doesn’t use composer natively

  • vindur

    What about adding https://github.com/spryker/code-sniffer detection?

  • https://www.martinhujer.cz Martin Hujer

    What happens if I have some standard installed, but I have a custom phpcs.xml in the project root, which disables some rules from that standard. Will this config be used instead of a detected standard?

    • Dmitry Tronin

      It will be using the one defined by phpcs.xml.

  • http://moviebyte.com/ TJ Draper

    I have a phpmd.xml in the root of my project and I did composer require phpmd/phpmd –dev. To my delight, when I enabled the PHPMD inspection it already seemed to have added that custom standard. However the inspection still had to be manually enabled.

    I also have a phpcs.xml file in the root of my project, I did composer require squizlabs/php_codesniffer –dev. Unfortunately, I both had to enable the inspection manually and had to set the Coding standard to custom and then add the path to phpcs.xml. I would love for all this to be automatic. Yes for me so I don’t have to remember to do this for every project, but also for my other devs who are never going to remember to go through all these steps every time they clone down a project to work on.

  • Jessie Hernandez

    Please add PSR-2!

  • Chad Solomon

    I couldn’t see how to add to the issue tracker, but can CakePHP be added? https://github.com/cakephp/cakephp-codesniffer

  • Matt

    PHPStan has been around for a while now, and it offers varying degrees of static analysis rules. Ever since I started using it, I was always hoping for some integration with PHPStorm: https://github.com/phpstan/phpstan

    • Dmitry Tronin
      • Matt

        While I appreciate that, it doesn’t appear to actually be on your TODO list. This appears to be a stale YouTrack ticket that’s been open for almost two years, with “no news” about any potential implementation.

        • Dmitry Tronin

          While it might look so – it doesn’t. This request is being often discussed internally.
          While I can’t give you any ETA on it, I can reassure you that the request isn’t being ignored at all.

  • http://maximals.ru/ MaximAL

    I would like PSR-2T (PSR-2 with SmartTabs) standard to be added as well.

    • Dmitry Tronin

      Could you please share a link to it?

  • Marwan

    Hi, Thanks a lot.
    Please add following code standard cakephp-codesniffer