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

initialize()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 10

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
nc 1
nop 0
dl 0
loc 10
rs 9.9332
c 0
b 0
f 0
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