Passed
Branch master (6982d9)
by Ivan
02:35
created

ExactMatchVoter::matches()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 7
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 7
rs 9.4285
c 0
b 0
f 0
cc 2
eloc 3
nc 2
nop 2
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Everlution\Navigation\Match\Voter;
6
7
use Everlution\Navigation\Match\MatchInterface;
8
use Everlution\Navigation\Match\VoterInterface;
9
10
/**
11
 * Class ExactMatchVoter.
12
 *
13
 * @author Ivan Barlog <[email protected]>
14
 */
15
class ExactMatchVoter implements VoterInterface
16
{
17
    public function matches(string $url, MatchInterface $match): bool
18
    {
19
        if (false === $match instanceof ExactMatch) {
20
            return false;
21
        }
22
23
        return $url === $match->getValue();
24
    }
25
}
26