Skip to content

2026

Do your unit tests depend on the system clock?

Testing code that uses new DateTime('now') or time() is painful. You end up mocking native functions, or accepting fragile tests that fail at midnight.

Direct dependency on a concrete implementation causes the same kind of problems for the logger, the cache, or the ID generator...

CQRS everywhere? No, only where it's useful

In many PHP projects, CQRS is applied systematically. Every operation goes through a Command or Query Bus, with handlers, middleware, and event dispatching. For a homepage that displays three statistics, that is pointless boilerplate.

CQRS is not the problem. Its systematic application is.