phpstan

  • A baseline you use, versus a baseline you hide behind

    A baseline lets a project adopt a level today and fix the existing violations over time, and it becomes a lie the moment it is allowed to grow.…

  • PHPStan 1.0 promises backward compatibility for the levels

    After five years of 0.x, 1.0 in November is a commitment that a level will not start reporting new errors in a patch release. The practical difference is…

  • PHPStan level 8 is nullability and nothing else

    Level 8 checks calls on values that may be null, and it is the level where most projects discover how much of their code assumes otherwise. The temptation…

  • ignoreErrors with a message regex ages badly

    Ignoring an error by matching its message couples the configuration to wording that changes between releases. reportUnmatchedIgnoredErrors is on by default and worth keeping on, because it turns…

  • Generics in a docblock are checked by nothing at runtime

    PHP has no generics, so @return list<Order> is a promise to the analyser and a comment to the engine. The annotations are genuinely useful and are genuinely unenforced:…

  • Psalm and PHPStan disagree, and both are right

    The two analysers have different defaults and different opinions about the same code, and running both is rarely worth it. Psalm’s taint analysis is the one genuinely differentiating…

  • A PHPStan baseline that can only shrink

  • Union types, promotion, and match

    8.0 shipped in November with three changes that alter how a class is written, and a fourth that quietly breaks string-to-number comparison.

  • Static analysis on changed files in a hook

    A full analysis on a large codebase takes long enough that nobody runs it before committing, so every finding arrives from CI after the context has been lost.…

  • A PHPStan extension for a magic method

    Frameworks built on __call and facades produce hundreds of findings that are all the same false positive, and putting them in the baseline hides real errors of the…