Screenshot of a comment on GitHub showing the baseline reduced by 1

Gamifying Psalm baseline reduction

When using PHP static analysis tools like Psalm, how do we motivate a team to work on decreasing the baseline? Gamification! ❓ Static analysis? When writing modern PHP code, static analysis tools like Psalm and PHPStan are essential to prevent mistakes caused by PHP’s dynamic nature. They provide types not in the language, generics and much more. 📋 What’s a baseline? To introduce these tools into legacy code is quite a challenge: It’s a huge task to immediately fix all errors. This is why they allow you to create a baseline file: a file that lists all current errors and tells the tool to ignore them for now. This is great to ensure the quality of new code, and means you don’t have to refactor all existing code at once. ...

February 24, 2023 · Anner Visser