FQSENMatcher::__construct()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

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