php

  • Mutation testing on a third directory, and a worse score

    A technique applied to a third directory, with a score of thirty-eight per cent and a good reason. A low score on code whose correctness is asserted at…

  • PSR-3 context, and the field that was finally queried

    A structured logging field added in 2023, never queried, and the one week it was the only thing that helped. A field with no queries against it for…

  • The value object library, five years on

    32 value objects in 2021, 41 now, and a retrospective on which of them earned their place. No symptom — a deliberate look.

  • A value object with no invariant, deleted

    Eight single-property wrappers over a string, none of which validated anything. A value object with no invariant is a type alias that PHP does not have, and the…

  • The two PHP templates that survived, and the rule

    Two templates that cannot become block templates, and the rule that identifies them. Three years and the rule has held for every template that came up, which is…

  • opcache after a year of property hooks

    Two hundred and eighteen methods became properties, and the question of whether the opcode cache noticed. A hook costs about what a method call costs because it is…

  • A functions.php of forty lines

    A file that was eight hundred lines in 2022, and what is left in it. Everything else moved to a plugin, and the test for each was whether…

  • Writing a PHPUnit extension

    turkerdev/phpunit-json-coverage-report, and a coverage report a machine can read. Coverage as a percentage in a log, and no way to ask which paths changed.

  • A readonly class that survived a requirements change

    A value object made readonly in 2022, and the requirement in 2026 that would have broken a mutable one. The property that mattered was not thread safety or…

  • A trait deleted after its second use appeared

    A trait extracted in 2023 for one class, on the grounds that a second would arrive, and the second one arriving and not fitting. A trait extracted in…