GitHub Access Token became invalid

It seems like the GitHub access token used for retrieving details about this repository from GitHub became invalid. This might prevent certain types of inspections from being run (in particular, everything related to pull requests).
Please ask an admin of your repository to re-new the access token on this website.
Completed
Push — master ( a669d2...17370b )
by Benjamin
02:59
created

Router   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 21
Duplicated Lines 0 %

Test Coverage

Coverage 0%

Importance

Changes 0
Metric Value
dl 0
loc 21
ccs 0
cts 7
cp 0
rs 10
c 0
b 0
f 0
wmc 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A route() 0 3 1
A __construct() 0 5 1
1
<?php
2
3
namespace App\Lib\Routing;
4
5
use Psr\Http\Message\RequestInterface;
6
7
class Router
8
{
9
    /**
10
     * @var UrlMatcher
11
     */
12
    private $matcher;
13
    /**
14
     * @var RouteLoader
15
     */
16
    private $loader;
17
18
    public function __construct(RouteLoader $loader = null, UrlMatcher $matcher = null)
19
    {
20
        $this->loader  = $loader ?? new RouteLoader();
21
        $collection    = $this->loader->loadRoutes();
22
        $this->matcher = $matcher ?? new UrlMatcher($collection);
23
    }
24
25
    public function route(RequestInterface $request)
26
    {
27
        return $this->matcher->match($request->getUri()->getPath());
28
    }
29
}
30