SymfonyRouteRouterFactory::__invoke()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 12
Code Lines 6

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 6
CRAP Score 1

Importance

Changes 0
Metric Value
dl 0
loc 12
ccs 6
cts 6
cp 1
rs 9.4285
c 0
b 0
f 0
cc 1
eloc 6
nc 1
nop 1
crap 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace WShafer\Expressive\Symfony\Router;
6
7
use Psr\Container\ContainerInterface;
8
use Symfony\Component\Routing\Generator\UrlGenerator;
9
use Symfony\Component\Routing\Matcher\UrlMatcher;
10
use Symfony\Component\Routing\RouteCollection;
11
use WShafer\Expressive\Symfony\Router\Cache\Cache;
12
13
class SymfonyRouteRouterFactory
14
{
15 1
    public function __invoke(ContainerInterface $container) : SymfonyRouteRouter
16
    {
17 1
        $urlMatcher = $container->get(UrlMatcher::class);
18
19 1
        $urlGenerator = $container->get(UrlGenerator::class);
20
21 1
        $routes = $container->get(RouteCollection::class);
22
23 1
        $cache = $container->get(Cache::class);
24
25 1
        return new SymfonyRouteRouter($routes, $urlMatcher, $urlGenerator, $cache);
26
    }
27
}
28