Life is complicated. PHP can be, too. Psalm is designed to understand that complexity, so it can quickly pinpoint type errors in your codebase.
You should use Psalm if you run PHP 5.6+ or PHP 7.0+, and:
composer require --dev vimeo/psalm
Add a config:
Then run Psalm:
The config created above will show you all issues in your code, but will emit
INFO issues (as opposed to
ERROR) for certain common trivial code problems. If you want a more lenient config you can specify the level with
./vendor/bin/psalm --init [source_dir] [level]
You can also learn how to suppress certain issues.
Want to know more? Check out the docs!