Archive
doctrine
-
Property hooks, and the three places they earn their keep
PHP 8.4 shipped in November. Three weeks of converting getter and setter pairs to property hooks got me to nine, and Doctrine ORM throws if you put one on an entity. Notes on where the feature actually pays.
-
Enums replaced forty class constants
PHP 8.1 shipped on 25 November. A status class holding 41 constants, a static validator and a switch with a throwing default became one backed enum, and Doctrine still needed thirty lines of custom type to store it.
-
PHPStan level 6 on a codebase from 2014
Two weeks of static analysis on a seven-year-old Symfony application: 417 errors at level 0, 8,996 at level 6, one nullable return that 611 passing tests never touched, and the rule about what may enter a baseline.
-
Messenger, and the queue we should have built two years earlier
We ran background work off a cron and a pending_jobs table for five years. Replacing it with Symfony Messenger took three weeks and taught me what retries, a failure transport and mortal workers are actually for.
-
Doctrine migrations, and why the Friday deploy broke
A generated diff, a NOT NULL column with no default, and a deploy that ran migrations before it flipped the symlink. 213 failed inserts on a Friday evening, and the expand and contract ordering I should have used.