Skip to content
Advertisement

Tag: liskov-substitution-principle

DRY and Typing Specialization

while I was learning PHP, I thought of a (simple?) problem that I could not solve “properly”. Here it is: I would like to create multiple “specialized containers” I would like to avoid duplicated code For example: So, I could then create “specialized” bag: I understood that it’s not possible in PHP, as it is breaking the Liskov Substitution Principle.

Advertisement