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_number |
||
9 | extends AbstractComponent |
||
|
|||
10 | implements ValueComponentInterface, |
||
11 | DisableableComponentInterface, |
||
12 | FilterableComponentInterface, |
||
13 | ValidatableComponentInterface |
||
14 | { |
||
15 | public function default_model() |
||
32 | |||
33 | public function filter($v) |
||
37 | |||
38 | public function validation($v,&$e) |
||
54 | |||
55 | public function required_arguments() |
||
59 | |||
60 | public function get_template_path() |
||
64 | } |