PHPUnit 10, and the event system that replaced listeners

The old TestListener interface is gone, and the replacement is a set of typed events with subscribers.

final class SlowTestSubscriber implements FinishedSubscriber
{
    public function notify(Finished $event): void
    {
        if ($event->telemetryInfo()->durationSinceStart()->asFloat() > 1.0) {
            fwrite(STDERR, $event->test()->id() . "n");
        }
    }
}

// registered through an extension bootstrap class

The typed events are a genuine improvement over a nine-method interface where seven methods were empty, and the migration is not mechanical — the information available differs. Our slow-test reporter was thirty lines and came out at fifteen; the one that counted database queries had to be rewritten entirely because the event carries no such hook, and it became a trait on the base test case.