Completed
Branch Gutenberg/master (3b2a95)
by
unknown
118:45 queued 105:17
created

RouteMatchSpecificationDependencyResolver   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 20
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Importance

Changes 0
Metric Value
dl 0
loc 20
rs 10
c 0
b 0
f 0
wmc 1
lcom 0
cbo 2

1 Method

Rating   Name   Duplication   Size   Complexity  
A initialize() 0 10 1
1
<?php
2
3
namespace EventEspresso\core\services\route_match;
4
5
use EventEspresso\core\exceptions\InvalidAliasException;
6
use EventEspresso\core\services\dependencies\ClassAlias;
7
use EventEspresso\core\services\dependencies\DependencyResolver;
8
9
/**
10
 * Class RouteMatchSpecificationDependencyResolver
11
 * RouteMatchSpecification classes that only have dependencies for the RequestInterface
12
 * or other RouteMatchSpecification classes can have their dependencies automatically resolved
13
 * and do not need to be registered by calling EE_Dependency_Map::registerDependencies()
14
 * or manually adding an entry in the dependency map.
15
 * RouteMatchSpecification classes with more complex dependencies
16
 * will still have to register their dependencies normally.
17
 *
18
 * @package EventEspresso\core\services\route_match
19
 * @author  Brent Christensen
20
 * @since   $VID:$
21
 */
22
class RouteMatchSpecificationDependencyResolver extends DependencyResolver
23
{
24
25
    /**
26
     * Used to configure and/or setup any aliases or namespace roots required by the DependencyResolver
27
     *
28
     * @since $VID:$
29
     * @throws InvalidAliasException
30
     */
31
    public function initialize()
32
    {
33
        $this->addAlias(
34
            new ClassAlias(
35
                'EventEspresso\core\services\request\RequestInterface',
36
                'EventEspresso\core\services\request\Request'
37
            )
38
        );
39
        $this->addNamespaceRoot('EventEspresso\core\domain\entities\route_match\specifications');
40
    }
41
}
42