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 |
||
| 13 | class DatetimeUpdate extends EntityMutator |
||
| 14 | { |
||
| 15 | |||
| 16 | /** |
||
| 17 | * Defines the mutation data modification closure. |
||
| 18 | * |
||
| 19 | * @param EEM_Datetime $model |
||
| 20 | * @param Datetime $type |
||
| 21 | * @return callable |
||
| 22 | */ |
||
| 23 | View Code Duplication | public static function mutateAndGetPayload(EEM_Datetime $model, Datetime $type) |
|
| 67 | } |
||
| 68 |