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 |
||
29 | class Sounds extends AriClientAware |
||
30 | { |
||
31 | /** |
||
32 | * List all sounds. |
||
33 | * |
||
34 | * @return Sound[] |
||
35 | */ |
||
36 | 1 | View Code Duplication | public function getSounds() |
48 | |||
49 | /** |
||
50 | * Get a sound's details. |
||
51 | * |
||
52 | * @param string $soundId Sound's id |
||
53 | * @return Sound |
||
54 | */ |
||
55 | 1 | View Code Duplication | public function getSound($soundId) |
62 | } |
||
63 |