What does good, clean PHP code look like? This somewhat opinionated talk will cover marquis and key indicators of good PHP code. Hit on best practices, see how to measure code with metrics with PHPMD, and refresh on guardrails like PHPCS and PHPStan. Use these tools and tips to really start writing beautiful PHP code that is readable, testable, and has good architecture.

Comments

Please login to leave a comment

Chris Jones at 11:43 on 21 May 2025

Solid overview of current tooling around checking the health of your project. Included style tools, guardrails, and static analysis

I really enjoyed the snowmobile parallel at the beginning, and the talk gives a great overview of not only why metrics are important but specific tools that we can use to help put numbers to the broad idea of code quality (e.g. static code analysis, coverage, etc.). Better yet, I picked up a few new ones that I haven't worked with (PHPMD, PhpMetrics, pheromone/phpcs-security-audit)

I think the talk would benefit from a bit more "the numbers help tell a story, but it's not everything" (e.g. you could have 100% code coverage, but if the tests are only covering the happy paths there's limited value). Knowing that talks like this will tend to attract leadership types at the conference, it's probably important to include this disclosure ;)

Great overview of both key metrics to consider and think around for a given codebase, as well as tooling to facilitate analysis. Left with new ideas to consider what metrics are most important, and ways to build procedures around review and improvement of key metrics.

Peter Meth at 15:41 on 21 May 2025

I had to leave a bit early to take care of an issue, but the part I saw was a nice overview of some of the metrics we can use to.improve our code.

Dana Luther at 15:28 on 22 May 2025

Fantastic talk. I walked out with some key new tools for metrics (hadn’t used phpmd before).

The examples were clear and the delivery was very engaging.