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.4+ or PHP 7.0+, and:
Install via Composer or download via GitHub:
composer require --dev vimeo/psalm
Add a config:
./vendor/bin/psalm --init
Then run Psalm:
./vendor/bin/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 wiki!