mirror of
https://github.com/jupeter/clean-code-php.git
synced 2025-10-01 00:16:42 +02:00
correct Good solutuin
This commit is contained in:
@@ -1199,10 +1199,11 @@ foreach ($rectangles as $rectangle) {
|
||||
}
|
||||
```
|
||||
|
||||
**Not good:**
|
||||
**Good:**
|
||||
|
||||
You can separate client for differen shapes.
|
||||
But this is not a best solution becous the square is still must be a subtype of the rectangle.
|
||||
You must separate different shapes.
|
||||
Despite the apparent similarity of the square and the rectangle, this is not so.
|
||||
A square also has much in common with a rhombus, but it is not a subtype of a rhombus.
|
||||
|
||||
```php
|
||||
interface Shape
|
||||
|
Reference in New Issue
Block a user