Typestate-Oriented programming in PHP? Possible?
https://typephp.dev/blog/making-legal-states-impossible-in-place-typestates-in-pure-php

TypePHPMaking Illegal States Impossible: In-Place Typestates in Pure PHP | TypePHPWhy C#, Java, and Rust cannot mutate generic types in-place, the deep computer science behind Typestate-Oriented Programming, and how TypePHP reifies mutable generics at runtime in pure PHP.
commit eb71671
Modeling state transitions with distinct types or generic templates so PHPStan catches calling ship() on an unpaid order before code even runs is such a clean pattern.