4. Interface Segregation principle - mrbahadoor/symfony5-solid GitHub Wiki

Definition
Clients should not be forced to depend on interfaces (not literally interfaces but the abstract concept of interfaces) they do not use.

Simplified definition
Build small, focused classes, instead of big, giant classes.

Goal
Avoid injecting bulky classes (many public methods) when only one or a few methods method will be used by the client (controller or calling class).

Solution
Split classes with methods that are used together:

image

Benefits
Keep lower dependencies

See example: 3419ac3b4d275204e0757d942e02da1949302d85

⚠️ **GitHub.com Fallback** ⚠️