Passed
Pull Request — master (#160)
by Dmitriy
04:52 queued 02:01
created

UrlMatcherInterfaceProxy::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 2
Code Lines 0

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
eloc 0
dl 0
loc 2
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 2
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Yiisoft\Yii\Debug\Collector\Web;
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