The PHP podcast where everyone chimes in.

Originally aired on

June 12th, 2018

073: PHP Static Analysis

Static analysis is a fancy word to describe a tool that looks at our code and gives us helpful hints on how to improve it. We'll be discussing what static analyzers do, which tools the PHP community has access to, and how we can incorporate the tools into our daily development flow.

with


Using static analyzers to improve our PHP codebases Show Summary


Static Code Analyzers

Static code analysis tools maintained by the guests:

Learnings and Recommendations

In no particular order:

  • Start simple by installing one of these or other tools and let it analyze your code base.
  • Integrate static code analysis into your continuous integration process.
  • Most tools support error levels so you can fine-tune your checks.
  • Go for easy fixes that stand out in your code base first.
  • Static code analysis is useful for PHP projects because PHP is not a compiled language and does not get type-checked by a compiler.

Misc

Colin O'Dell asked for a working PHPStan config for Drupal 8 during the recording of the podcast. Here it is.


Craig Duncan


Vladimir Reznichenko


Damien Seguy


Show Notes Credit

Thank you Matthias Gutjahr for authoring the show notes for this episode!

If you'd like to contribute show notes and totally get credit for it, check out the show-notes repo!