composer-phpphpstormphpstan

Can I run the PHPStan setup script manually?


I am using the devspaces tool as part of a project with a few dozen developers. It's great, but in order to make certain things work locally in my IDE, I still run Composer on my local machine occasionally. For a variety of reasons I won't get into, I generally run it without setup scripts, which is for most purposes fine.

However, ever since doing a composer install --no-scripts on my local machine, I now get notices in PhpStorm saying PHPStan: No rules detected.

Is there a way I can run the PHPStan setup script manually by itself in order to get my rules back?


Solution

  • I'm not sure what led to this problem, but the ideal path forward is to learn how to run PHPStan by yourself. PHPStan will rarely show "No rules detected" unless you do something really weird or custom.

    PHPStan wants you to set --level on the command line, or set a level parameter in your configuration file (phpstan.neon). With the rule level set, there will always be some rules to run.

    I recommend you to start here: Getting Started