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 Markdown extends AbstractField |
||
| 9 | { |
||
| 10 | use Orderable; |
||
| 11 | |||
| 12 | 1 | public function value(Request $request) |
|
| 16 | |||
| 17 | 1 | public function getListValue($model) |
|
| 24 | |||
| 25 | 1 | View Code Duplication | public function getEditFormValue($model) |
| 34 | |||
| 35 | 1 | public function getCreateFormValue() |
|
| 41 | } |
||
| 42 |