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 |
||
5 | class CapturesResponse extends CaptureBase |
||
6 | { |
||
7 | /** |
||
8 | * Gets the 'status' parameter. |
||
9 | * |
||
10 | * @return LiftError[]|null The errors, if there were any |
||
11 | */ |
||
12 | 9 | View Code Duplication | public function getErrors() |
25 | |||
26 | /** |
||
27 | * Gets the 'matched_segments' parameter. |
||
28 | * |
||
29 | * @return Segment[] |
||
30 | */ |
||
31 | 6 | View Code Duplication | public function getMatchedSegments() |
41 | } |
||
42 |