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 |
||
18 | class JsonDefinitionRelTest extends BaseJsonDefinitionFieldTest |
||
19 | { |
||
20 | /** |
||
21 | * Test JsonDefinitionRel::getName() |
||
22 | * |
||
23 | * @return void |
||
24 | */ |
||
25 | View Code Duplication | public function testGetName() |
|
33 | |||
34 | /** |
||
35 | * Test JsonDefinitionRel::getType() |
||
36 | * |
||
37 | * @return void |
||
38 | */ |
||
39 | View Code Duplication | public function testGetType() |
|
47 | |||
48 | /** |
||
49 | * Test JsonDefinitionRel::getTypeDoctrine() |
||
50 | * |
||
51 | * @return void |
||
52 | */ |
||
53 | View Code Duplication | public function testGetTypeDoctrine() |
|
61 | |||
62 | /** |
||
63 | * Test JsonDefinitionRel::getTypeSerializer() |
||
64 | * |
||
65 | * @return void |
||
66 | */ |
||
67 | View Code Duplication | public function testGetTypeSerializer() |
|
75 | |||
76 | /** |
||
77 | * Test JsonDefinitionRel::getDefAsArray() |
||
78 | * |
||
79 | * @return void |
||
80 | */ |
||
81 | public function testGetDefAsArray() |
||
105 | } |
||
106 |