UrlGeneratorFactory   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 11
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
wmc 1
eloc 4
dl 0
loc 11
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A __invoke() 0 9 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace WShafer\Mezzio\Symfony\Router\Container;
6
7
use Psr\Container\ContainerInterface;
8
use Symfony\Component\Routing\Generator\UrlGenerator;
9
use Symfony\Component\Routing\RequestContext;
10
use Symfony\Component\Routing\RouteCollection;
11
12
class UrlGeneratorFactory
13
{
14
    public function __invoke(ContainerInterface $container): UrlGenerator
15
    {
16
        /** @var RouteCollection $routeCollection */
17
        $routeCollection = $container->get(RouteCollection::class);
18
19
        /** @var RequestContext $context */
20
        $context = $container->get(RequestContext::class);
21
22
        return new UrlGenerator($routeCollection, $context);
23
    }
24
}
25