RouteResolver   A
last analyzed

Complexity

Total Complexity 4

Size/Duplication

Total Lines 23
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

Changes 0
Metric Value
wmc 4
lcom 0
cbo 1
dl 0
loc 23
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A __invoke() 0 20 4
1
<?php
2
3
/**
4
 * @author Jared King <[email protected]>
5
 *
6
 * @link http://jaredtking.com
7
 *
8
 * @copyright 2015 Jared King
9
 * @license MIT
10
 */
11
namespace Infuse\Services;
12
13
class RouteResolver
14
{
15
    public function __invoke($app)
16
    {
17
        $handler = new \Infuse\RouteResolver();
18
        $handler->setApp($app);
19
20
        $config = $app['config'];
21
        if ($namespace = $config->get('router.namespace')) {
22
            $handler->setNamespace($namespace);
23
        }
24
25
        if ($defaultController = $config->get('router.defaultController')) {
26
            $handler->setDefaultController($defaultController);
27
        }
28
29
        if ($defaultAction = $config->get('router.defaultAction')) {
30
            $handler->setDefaultAction($defaultAction);
31
        }
32
33
        return $handler;
34
    }
35
}
36