RequestMatcher::matches()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 6
rs 9.4285
c 0
b 0
f 0
cc 1
eloc 3
nc 1
nop 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