php

  • Health routing, and the check we already had

    A framework health route that returns 200 if the application boots, next to ours that checks the database and the cache. These answer different questions and using one…

  • A job with a unique lock that outlived the job

    A job marked unique so it cannot be queued twice, and a worker killed mid-run leaving the lock held for its full duration. The hour was chosen when…

  • Laravel 11, and the Kernel classes that are gone

    The March release removes the HTTP and console kernels from the skeleton, which is a structural change rather than a rename. The upgrade does not require this —…

  • Per-second rate limiting, and the burst it exposed

    Laravel 11 allows a per-second limit, and applying one to an endpoint limited to sixty a minute showed what that had actually been permitting. A per-minute limit is…

  • A constructor that validated three things and threw one exception

    A value object rejecting an invalid input with a message that named the type rather than the problem. One check per condition and a named constructor per failure…

  • PSR-20 clocks, and the fake I stopped writing

    A clock interface written by hand in four projects, each slightly different, replaced by the standard one. One method returning a DateTimeImmutable is a small enough interface that…

  • Reading a stream instead of file_get_contents

    An import that read a 900 MB CSV into a string, on a worker with a 512 MB memory limit, and had been working because the file used…

  • The font library, and the licences nobody had checked

    6.5 in April, fonts become something an editor can install, and a site with eleven web fonts of which four are loaded and unused.

  • register_block_type from a manifest, in one call

    Eleven blocks, eleven register_block_type calls, eleven block.json files read from disk on every request. Eleven file reads and eleven JSON parses on every request is not a lot…

  • Composer 2.7 and the bump command

    composer bump raises the constraints in composer.json to match what is installed, which is either exactly what you want or exactly what you do not. The distinction between…