From 6f72952991307211d4a9974a2c5a889aa9da352c Mon Sep 17 00:00:00 2001 From: kenziehong Date: Thu, 14 Jan 2021 21:34:42 +0700 Subject: [PATCH] violate interface segregation --- Basic/Solid/ShapeInterface.php | 1 + Basic/Solid/doc.md | 6 +++++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/Basic/Solid/ShapeInterface.php b/Basic/Solid/ShapeInterface.php index aae0f75..063ac22 100644 --- a/Basic/Solid/ShapeInterface.php +++ b/Basic/Solid/ShapeInterface.php @@ -2,4 +2,5 @@ interface ShapeInterface { public function area(); + public function volume(); } \ No newline at end of file diff --git a/Basic/Solid/doc.md b/Basic/Solid/doc.md index 002bd2e..9f70d7d 100644 --- a/Basic/Solid/doc.md +++ b/Basic/Solid/doc.md @@ -10,4 +10,8 @@ Let q(x) be a property provable about objects of x of type T. Then q(y) should b q(x) x of type T q(y) y of type S (subtype of T) -This means that every subclass or derived class should be substitutable for their base or parent class. \ No newline at end of file +This means that every subclass or derived class should be substitutable for their base or parent class. + +# Interface Segregation Principle +A client should never be forced to implement an interface that it doesn’t use, or clients shouldn’t be forced to depend on methods they do not use. +