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 |
||
28 | class AliasContainerConfigurator implements ContainerConfiguratorInterface |
||
29 | { |
||
30 | /** |
||
31 | * @var AliasContainerInterface |
||
32 | */ |
||
33 | private $container; |
||
34 | |||
35 | /** |
||
36 | * @param AliasContainerInterface $container |
||
37 | */ |
||
38 | 8 | public function __construct(AliasContainerInterface $container) |
|
42 | |||
43 | /** |
||
44 | * {@inheritdoc} |
||
45 | */ |
||
46 | 5 | View Code Duplication | public function configure($config) |
62 | /** |
||
63 | * {@inheritdoc} |
||
64 | */ |
||
65 | 5 | public function configureOne($alias, $concrete) |
|
73 | } |
||
74 |