In this post over on Medium.com Ond?ej Mirtes looks at what he calls the "Three Pillars of Static Analysis in PHP" - three kinds of testing you can do to catch errors "at rest" in your codebase.
My credo is that everything that can be automated should be automated. Computers are really good at repeating tedious tasks and they don’t usually make mistakes while us squishy humans are defined by making mistakes everywhere we go.[...] In the following article, I’d like to introduce three tools that will help you to find errors and inconsistencies in your codebase. If your build integrating these tools finishes successfully, you can be pretty sure your application is in a good shape.
His list of three tools covers checking for:
- syntax errors using PHP-Parallel-Lint
- PHP_CodeSniffer "sniffs" to ensure code consistency
- using PHPStan to check for more complex bugs and issues than the other two
He covers some of the things the last option verifies and links to another introductory article about the tool to help you get started.