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 |
||
| 15 | class EditFormFactory extends DefaultFormFactory |
||
| 16 | { |
||
| 17 | private static $extensions = [ |
||
|
|
|||
| 18 | ControllerExtension::class |
||
| 19 | ]; |
||
| 20 | |||
| 21 | View Code Duplication | protected function getFormFields(RequestHandler $controller = null, $name, $context = []) |
|
| 30 | |||
| 31 | View Code Duplication | protected function getFormActions(RequestHandler $controller = null, $name, $context = []) |
|
| 39 | } |
||
| 40 |