Duplicate code is one of the most pungent code smells. A rule that is often used is to re-structure code once it is duplicated in three or more places.
Common duplication problems, and corresponding solutions are:
1 | <?php |
||
13 | View Code Duplication | final class Psr18ClientDiscovery extends ClassDiscovery |
|
14 | { |
||
15 | /** |
||
16 | * Finds a PSR-18 HTTP Client. |
||
17 | * |
||
18 | * @return ClientInterface |
||
19 | * |
||
20 | * @throws Exception\NotFoundException |
||
21 | */ |
||
22 | public static function find() |
||
36 | } |
||
37 |