Completed
Branch EDTR/master (83b47e)
by
unknown
25:37 queued 16:41
created

PublicRoute   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 31
Duplicated Lines 35.48 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

Changes 0
Metric Value
dl 11
loc 31
rs 10
c 0
b 0
f 0
wmc 1
lcom 0
cbo 1

1 Method

Rating   Name   Duplication   Size   Complexity  
A __construct() 11 11 1

How to fix   Duplicated Code   

Duplicated Code

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
2
3
namespace EventEspresso\core\domain\entities\routing\handlers\frontend;
4
5
use EE_Dependency_Map;
6
use EE_Maintenance_Mode;
7
use EventEspresso\core\services\routing\Route;
8
use EventEspresso\core\domain\entities\routing\specifications\RouteMatchSpecificationInterface;
9
use EventEspresso\core\services\json\JsonDataNode;
10
use EventEspresso\core\services\loaders\LoaderInterface;
11
use EventEspresso\core\services\request\RequestInterface;
12
13
/**
14
 * Class Route
15
 * - class for detecting and matching with incoming requests
16
 * (this can be done by directly examining the incoming Request
17
 * or via a Route Match Specification class for better SRP and sharing)
18
 * - registers dependencies for any classes that are required from that point forwards in the request
19
 * - loads additional classes for handling the request
20
 *
21
 * @package EventEspresso\core\services\routing
22
 * @author  Brent Christensen
23
 * @since   $VID:$
24
 */
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(
45
        EE_Maintenance_Mode $maintenance_mode,
46
        EE_Dependency_Map $dependency_map,
47
        LoaderInterface $loader,
48
        RequestInterface $request,
49
        JsonDataNode $data_node = null,
50
        RouteMatchSpecificationInterface $specification = null
51
    ) {
52
        $this->maintenance_mode = $maintenance_mode;
53
        parent::__construct($dependency_map, $loader, $request, $data_node, $specification);
54
    }
55
}
56