RequestMatcher   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 14
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Importance

Changes 0
Metric Value
wmc 2
lcom 0
cbo 2
dl 0
loc 14
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A getFirewallName() 0 4 1
A matches() 0 6 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Symplify\SymfonySecurity\Tests\Adapter\Nette\DI\SymfonySecurityExtension\FirewallSource;
6
7
use Nette\Http\IRequest;
8
use Symplify\SymfonySecurity\Contract\HttpFoundation\RequestMatcherInterface;
9
10
final class RequestMatcher implements RequestMatcherInterface
11
{
12
    public function getFirewallName() : string
13
    {
14
        return 'adminFirewall';
15
    }
16
17
    public function matches(IRequest $request) : bool
18
    {
19
        $url = $request->getUrl();
20
        // match all, just for testing purposes only
21
        return strpos($url->getScriptPath(), '/') === 0;
22
    }
23
}
24