static-analysis

  • A dependency rule checked in CI beats a diagram

    An architecture diagram describes an intention and a dependency check describes what is true, and the two diverge from the first week. –report-uncovered is the flag worth turning…

  • A baseline whose line count may only fall

    A baseline lets a project adopt a level today and becomes a place to hide the moment it is allowed to grow. Regenerating the baseline to make a…

  • PHPStan level 9 is about mixed, and it is a project

    Level 9 requires every mixed to be narrowed before use, which is a different order of work from level 8. Every boundary that decodes JSON, reads a configuration…

  • A modular monolith enforces what a network boundary did not

    Splitting into services enforces nothing if they share a database; splitting into modules with a checked dependency rule enforces more. A build failure on a cross-module import is…

  • Generated model docblocks go stale in a week

    Model properties come from the database and the analyser cannot see the schema, so a generated docblock is the bridge and it drifts on the next migration. Generating…

  • Laravel 9 moved to Symfony 6 and took PHP 8 with it

    February, the first annual major, and a version number that means less than it used to. The work is two packages that block everything.

  • Intersection types cannot be nullable until 8.2

    Pure intersection types in 8.1 mean class and interface types only, which excludes the nullable case that most signatures need. The restriction to class types is what “pure”…

  • never is not void, and the analyser knows

    void means the function returns nothing and never means it does not return, and the second is information a static analyser can act on. The practical value is…

  • Enums, and the string column that was pretending

    8.1 on 25 November, and the feature PHP had been simulating with class constants for a decade. A status column holding three spellings of the same thing.

  • The framework extension is what makes level 8 possible

    A service container returning mixed and a model with magic properties defeat static analysis entirely without a framework-aware extension. The extension is not optional on a framework-heavy codebase…