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 |
||
25 | abstract class PublicRoute extends Route |
||
26 | { |
||
27 | |||
28 | /** |
||
29 | * @var EE_Maintenance_Mode $maintenance_mode |
||
30 | */ |
||
31 | protected $maintenance_mode; |
||
32 | |||
33 | |||
34 | /** |
||
35 | * FrontendRequests constructor. |
||
36 | * |
||
37 | * @param EE_Maintenance_Mode $maintenance_mode |
||
38 | * @param EE_Dependency_Map $dependency_map |
||
39 | * @param LoaderInterface $loader |
||
40 | * @param RequestInterface $request |
||
41 | * @param JsonDataNode $data_node |
||
42 | * @param RouteMatchSpecificationInterface $specification |
||
43 | */ |
||
44 | View Code Duplication | public function __construct( |
|
55 | } |
||
56 |