Running PHPStan in CI
Hi, since commit
ee3fafc9 in the
dev branch we're now running
PHPStan on merge requests. It's set up to run before the existing tests, so that it works as a (hopefully) less intensive sanity check before spending time on the more expensive tests.
PHPStan is a static code analyzer that is able to flag potential bugs and issues without running any code itself. At the current level (level 0) it will flag things like references to undefined variables, unused variables, wrong or missing return type from functions etc. I hope this will help prevent some of the more trivial issues to creep back in the code base.
I hope to raise this to level 1 once we have cleaned the code of the issues flagged by that level. If you want to help, you can run PHPStan locally from the directory where you have checked out the Hubzilla source code:
$ ./vendor/bin/phpstan -l1 > phpstan.log
(Make sure you have installed the dependencies with
composer install first!)
Pick an issue from the produced
phpstan.log, and make it go away :)
Happy hacking!