mirror of
https://github.com/jupeter/clean-code-php.git
synced 2025-10-01 08:26:41 +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.
|
You must separate different shapes.
|
||||||
But this is not a best solution becous the square is still must be a subtype of the rectangle.
|
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
|
```php
|
||||||
interface Shape
|
interface Shape
|
||||||
|
Reference in New Issue
Block a user