FQSENMatcher   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 20
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 5
dl 0
loc 20
rs 10
c 0
b 0
f 0
wmc 3

3 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 3 1
A isMatch() 0 3 1
A getPattern() 0 3 1
1
<?php
2
declare(strict_types=1);
3
4
namespace DependencyAnalyzer\DependencyGraph\StructuralElementPatternMatcher;
5
6
use DependencyAnalyzer\DependencyGraph\FullyQualifiedStructuralElementName\Base as FQSEN;
7
use DependencyAnalyzer\DependencyGraph\StructuralElementPatternMatcher\Matchable;
8
9
class FQSENMatcher implements Matchable
10
{
11
    /**
12
     * @var FQSEN
13
     */
14
    private $fqsen;
15
16
    public function __construct(FQSEN $fqsen)
17
    {
18
        $this->fqsen = $fqsen;
19
    }
20
21
    public function isMatch(FQSEN $target): bool
22
    {
23
        return $this->fqsen->include($target);
24
    }
25
26
    public function getPattern(): string
27
    {
28
        return $this->fqsen->toString();
29
    }
30
}
31