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

FastRouteFactory   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 15
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 2
Bugs 0 Features 0
Metric Value
eloc 10
c 2
b 0
f 0
dl 0
loc 15
ccs 8
cts 8
cp 1
rs 10
wmc 1

1 Method

Rating   Name   Duplication   Size   Complexity  
A __invoke() 0 13 1
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