UrlMatcherFactory::__invoke()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 9
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
eloc 3
dl 0
loc 9
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 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\Matcher\UrlMatcher;
9
use Symfony\Component\Routing\RequestContext;
10
use Symfony\Component\Routing\RouteCollection;
11
12
class UrlMatcherFactory
13
{
14
    public function __invoke(ContainerInterface $container): UrlMatcher
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 UrlMatcher($routeCollection, $context);
23
    }
24
}
25