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 |
||
19 | View Code Duplication | class Field_Text extends Field |
|
20 | { |
||
21 | /** |
||
22 | * The form field type. |
||
23 | * |
||
24 | * @var string |
||
25 | * |
||
26 | * @since 1.0 |
||
27 | */ |
||
28 | protected $type = 'Text'; |
||
29 | |||
30 | /** |
||
31 | * Method to get the field input markup. |
||
32 | * |
||
33 | * @return string The field input markup. |
||
34 | * |
||
35 | * @since 1.0 |
||
36 | */ |
||
37 | protected function getInput() |
||
52 | } |
||
53 |
This class, trait or interface has been deprecated. The supplier of the file has supplied an explanatory message.
The explanatory message should give you some clue as to whether and when the type will be removed from the class and what other constant to use instead.