A class named Utils, Helpers or Common has no definition, so nothing can be excluded from it. It grows monotonically, it is imported everywhere, and it ends up…
Backing off exponentially stops a failing dependency being hammered. What it does not stop is synchronisation: every client that failed at the same moment retries at the same…
Dependency injection is passing collaborators in rather than constructing them inside. A container is a tool for assembling those graphs automatically. The two get conflated so thoroughly that…
A class with a single meaningful method usually ends up named after the verb — PriceFormatter::format() — and read as a stutter at every call site. __invoke() lets…
Business logic in a controller is reachable from exactly one place: an HTTP request. The first time the same operation is needed from a console command, a queue…
The principle is abstract until you write the test. If exercising one method means stubbing five others that the code under test never calls, the interface is doing…
Replacing a direct call with an event feels like removing coupling. The dependency does not disappear — it moves from a line you can read into a subscriber…
A repository wrapping a single ORM, forwarding find to find, is indirection with nothing behind it — the abstraction has one implementation and will never have another, and…