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 |
||
36 | View Code Duplication | class UserServiceProvider implements ServiceProviderInterface |
|
37 | { |
||
38 | /** |
||
39 | * Registers services on the given container. |
||
40 | * |
||
41 | * This method should only be used to configure services and parameters. |
||
42 | * It should not get services. |
||
43 | * |
||
44 | * @param Container $pimple A container instance |
||
45 | */ |
||
46 | public function register(Container $pimple) |
||
59 | } |
||
60 |