RootRouteCollectionFactory   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 17
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Importance

Changes 3
Bugs 0 Features 0
Metric Value
wmc 3
c 3
b 0
f 0
lcom 0
cbo 2
dl 0
loc 17
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A __invoke() 0 9 3
1
<?php
2
/**
3
 * Dash
4
 *
5
 * @link      http://github.com/DASPRiD/Dash For the canonical source repository
6
 * @copyright 2013-2015 Ben Scholzen 'DASPRiD'
7
 * @license   http://opensource.org/licenses/BSD-2-Clause Simplified BSD License
8
 */
9
10
namespace Dash;
11
12
use Dash\Route\RouteManager;
13
use Dash\RouteCollection\LazyRouteCollection;
14
use Interop\Container\ContainerInterface;
15
16
/**
17
 * Factory for the root route collection.
18
 */
19
class RootRouteCollectionFactory
20
{
21
    /**
22
     * {@inheritdoc}
23
     *
24
     * @return LazyRouteCollection
25
     */
26
    public function __invoke(ContainerInterface $container)
27
    {
28
        $config = $container->has('config') ? $container->get('config') : [];
29
30
        return new LazyRouteCollection(
31
            $container->get(RouteManager::class),
32
            isset($config['dash']['routes']) ? $config['dash']['routes'] : []
33
        );
34
    }
35
}
36