UrlMatcherFactory::__invoke()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 10
Code Lines 4

Duplication

Lines 10
Ratio 100 %

Code Coverage

Tests 4
CRAP Score 1

Importance

Changes 0
Metric Value
dl 10
loc 10
ccs 4
cts 4
cp 1
rs 9.4285
c 0
b 0
f 0
cc 1
eloc 4
nc 1
nop 1
crap 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace WShafer\Expressive\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 View Code Duplication
class UrlMatcherFactory
0 ignored issues
show
Duplication introduced by
This class seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
13
{
14 1
    public function __invoke(ContainerInterface $container) : UrlMatcher
15
    {
16
        /** @var RouteCollection $routeCollection */
17 1
        $routeCollection = $container->get(RouteCollection::class);
18
19
        /** @var RequestContext $context */
20 1
        $context = $container->get(RequestContext::class);
21
22 1
        return new UrlMatcher($routeCollection, $context);
23
    }
24
}
25