David Maus M. A.

Digital Humanities Publishing

Today I Learned: Static code analysis for PHP projects

David Maus, 28.08.2019 · Permalink

Static code analysis for PHP project has gone a long way. Phan and PHPStan are two tools that use static code analysis to detect potential errors in my PHP project files.

Both are installed via Composer:

Installing Phan & PHPStan
dmaus@carbon ~/projects/php-project % composer require --dev phan/phan...dmaus@carbon ~/projects/php-project % vendor/bin/phan --init --init-level=1...dmaus@carbon ~/projects/php-project % composer require --dev phpstan/phpstan