Depend on abstractions (interfaces), not concrete implementations.
A class should not be forced to implement methods it does not use. php-guide.7z
If a Bird class has a fly() method, a Penguin subclass shouldn't override it to throw an error, as this violates the expectation that all birds in the system can fly. I: Interface Segregation Principle (ISP) Depend on abstractions (interfaces)
The acronym represents five essential rules for high-quality software architecture: S: Single Responsibility Principle (SRP) and only one
Objects of a superclass should be replaceable with objects of its subclasses without breaking the application.
A class should have one, and only one, reason to change.
A high-level OrderManager should depend on a generic PaymentProcessorInterface rather than a specific PayPalPayment class. 📦 Understanding the .7z Context