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 Number extends AbstractField |
||
| 14 | { |
||
| 15 | use Orderable; |
||
| 16 | use Nullable; |
||
| 17 | use Tooltip; |
||
| 18 | use Clipboard; |
||
| 19 | use Inline; |
||
| 20 | use Placeholder; |
||
| 21 | |||
| 22 | public function value(Request $request) |
||
| 31 | |||
| 32 | 1 | public function getListValue($model) |
|
| 39 | |||
| 40 | 1 | View Code Duplication | public function getEditFormValue($model) |
| 49 | |||
| 50 | 1 | public function getCreateFormValue() |
|
| 56 | } |
||
| 57 |