Should I use PHPStan generics for type-safe collections or hand-write a class per type?
Default to `list<Order>` docblocks with strict PHPStan in CI; add one generic `Collection<T>` for behavior, a concrete class only at a trust boundary.
Just Ask
Ask me anything about software architecture, careers, PHP, Go and the craft of building software; I answer here, in the open, for everyone. (Page 2/8)
Whatever's on your mind, don't hold back. Questions reach me directly; I answer the good ones and publish them on this page. Your email is never published.
Default to `list<Order>` docblocks with strict PHPStan in CI; add one generic `Collection<T>` for behavior, a concrete class only at a trust boundary.
Turn the promotion into a concrete move: pick one fuzzy problem nobody owns and carry it end to end for a quarter, from its definition to its rollout.
Log at ERROR when the line would wake someone at 3am and at WARN when it would not, log a failure once at its boundary, and alert on the ERROR rate.
Define readiness, liveness and startup as Kubernetes probes; keep HEALTHCHECK only if the image also runs under Compose, pointing both at one endpoint.
Instrument usage per partner, publish a dated sunset with Sunset and Deprecation headers on every response, run brownouts, and cut when usage nears zero.
Run EXPLAIN (ANALYZE, BUFFERS) in production, then ANALYZE the table and check n_dead_tup; tune autovacuum per-table for sessions and add a partial index.
Export NumGoroutine() as a metric, take a pprof goroutine dump at peak, make the spawn site behind the parked stacks honor ctx.Done(), then add goleak.
Run it fully strict and throwing in local and CI; in production keep it on but wire handleLazyLoadingViolationUsing to log without failing the request.
Add a backed enum on the same integer values, use tryFrom() at the boundaries, and keep the old constants as deprecated aliases while you move call sites.
Hold the new version at a canary weight and check 5xx and latency against a threshold; on breach, roll back to the last stable release and alert the team.