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 |
||
16 | class SectionLimitationTest extends BaseTest |
||
17 | { |
||
18 | /** |
||
19 | * Tests the SectionInput parser. |
||
20 | */ |
||
21 | public function testParse() |
||
49 | |||
50 | public function getParseHrefExpectationsMap() |
||
56 | |||
57 | /** |
||
58 | * Returns the section input parser. |
||
59 | * |
||
60 | * @return \eZ\Publish\Core\REST\Server\Input\Parser\SectionInput |
||
61 | */ |
||
62 | protected function internalGetParser() |
||
66 | |||
67 | /** |
||
68 | * Get the section service mock object. |
||
69 | * |
||
70 | * @return \eZ\Publish\API\Repository\SectionService |
||
71 | */ |
||
72 | View Code Duplication | protected function getSectionServiceMock() |
|
90 | } |
||
91 |