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 |
||
17 | View Code Duplication | class WithoutDoctrineKernel extends Kernel |
|
18 | { |
||
19 | |||
20 | private $addedBundles = []; |
||
21 | |||
22 | /** |
||
23 | * @inheritdoc |
||
24 | */ |
||
25 | public function registerBundles() |
||
35 | |||
36 | public function addBundle(Bundle $bundle): self |
||
42 | |||
43 | /** |
||
44 | * @inheritdoc |
||
45 | */ |
||
46 | public function registerContainerConfiguration(LoaderInterface $loader) |
||
50 | } |
||
51 |