Passed
Pull Request — master (#5)
by Ivan
01:48
created

ExactMatchVoter   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 11
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A matches() 0 8 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