PHPStan is a fantastic tool for a static analysis of PHP code. It reads the code and PHPDoc and will try to detect potential issues such as:
undefined variables incorrect types passed throughout the codebase use of non-existent methods and attributes passing of incorrect number of parameters t...