Passed
Push — master ( c5a3b1...3a525b )
by Alexander
01:15
created

FastRouteFactory::__invoke()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 13
Code Lines 9

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 8
CRAP Score 1

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 9
c 1
b 0
f 0
nc 1
nop 0
dl 0
loc 13
ccs 8
cts 8
cp 1
crap 1
rs 9.9666
1
<?php
2
3
namespace Yiisoft\Router\FastRoute;
4
5
use FastRoute\DataGenerator\GroupCountBased;
6
use FastRoute\RouteCollector;
7
use FastRoute\RouteParser\Std;
8
9
class FastRouteFactory
10
{
11 10
    public function __invoke()
12
    {
13 10
        $routeParser = new Std();
14 10
        $collector = new RouteCollector(
15 10
            $routeParser,
16 10
            new GroupCountBased()
17
        );
18
19 10
        return new FastRoute(
20 10
            $collector,
21
            $routeParser,
22
            static function ($data) {
23 1
                return new \FastRoute\Dispatcher\GroupCountBased($data);
24 10
            }
25
        );
26
    }
27
}
28