1
0
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:
Peter Gribanov
2017-09-05 14:14:42 +03:00
committed by GitHub
parent cb272de829
commit 263b32be16

View File

@@ -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