Im trying to setup PHPStan on a older, bigger, codebase. How could i exclude everything and than maybe by config define what to analyse.
I have thought about using a separate folder for it, but that would mean constantly moving files which might lead to breaking of the code. So i am hoping to exclude everything and then adding files to the analysers per file.
At this moment the only solution i was able to find is defining a script in composer.json
"scripts": {
"phpstan": "./vendor/bin/phpstan analyse --memory-limit=1G --no-progress --level 1 `cat phpstan_analyse_files`"
}
And keeping a list of files to analyise in the file phpstan_analyse_files
php phpstan.phar analyse src/index.php src/blog.php
so if you're using git, you can probably make a hood that triggers phpstan(or whatever tool you use phpstan with) – Sricat files_to_analyse
. If you have any other solutions im all ears – Annotatephpstan
,cat
) to achieve a complex outcome is the way to go ;) – Anatolio