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 |
||
8 | class Version20160908161616 extends AbstractMigration |
||
|
|||
9 | { |
||
10 | /** |
||
11 | * @param Schema $schema |
||
12 | */ |
||
13 | View Code Duplication | public function up(Schema $schema) |
|
25 | |||
26 | /** |
||
27 | * @param Schema $schema |
||
28 | */ |
||
29 | View Code Duplication | public function down(Schema $schema) |
|
39 | } |
||
40 |