Mathias Verraes illustrates with practical examples how PHP's type system can be used when designing a system.

Below is an attempt at illustrating a design/redesign process I went through at a client, who’s started refactoring the core systems their business depends on. Design is the part of software development that is the most messy, the hardest to fit into rules or well-defined processes. In fact, while writing this post, I tweeted: “There are surprisingly few software design books that recommend taking a walk, a shower, or a nap, as an important step.” None of the solutions offered below should be taken as truth. I may have already changed my mind on some of them by the time you read them.

http://verraes.net/2016/02/type-safety-and-money/