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 Component_text |
||
| 9 | extends AbstractComponent |
||
|
|
|||
| 10 | implements ValueComponentInterface, |
||
| 11 | DisableableComponentInterface, |
||
| 12 | FilterableComponentInterface, |
||
| 13 | ValidatableComponentInterface |
||
| 14 | { |
||
| 15 | View Code Duplication | public function default_model() |
|
| 29 | |||
| 30 | public function required_arguments() |
||
| 34 | |||
| 35 | public function get_template_path() |
||
| 39 | } |