Passed
Pull Request — master (#195)
by Dmitriy
12:21 queued 09:47
created

UrlMatcherInterfaceProxy::match()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 7
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 5
c 1
b 0
f 0
nc 1
nop 1
dl 0
loc 7
ccs 0
cts 5
cp 0
crap 2
rs 10
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Yiisoft\Router\Debug;
6
7
use Psr\Http\Message\ServerRequestInterface;
8
use Yiisoft\Router\MatchingResult;
9
use Yiisoft\Router\UrlMatcherInterface;
10
11
final class UrlMatcherInterfaceProxy implements UrlMatcherInterface
12
{
13
    public function __construct(private UrlMatcherInterface $urlMatcher, private RouterCollector $routerCollector)
14
    {
15
    }
16
17
    public function match(ServerRequestInterface $request): MatchingResult
18
    {
19
        $timeStart = microtime(true);
20
        $result = $this->urlMatcher->match($request);
21
        $this->routerCollector->collect(microtime(true) - $timeStart);
22
23
        return $result;
24
    }
25
}
26