Matcher   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 20
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
dl 0
loc 20
ccs 7
cts 7
cp 1
rs 10
c 0
b 0
f 0
wmc 3
lcom 0
cbo 0

3 Methods

Rating   Name   Duplication   Size   Complexity  
A forType() 0 4 1
A __invoke() 0 4 1
A __construct() 0 4 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace phpDocumentor\Descriptor\Builder;
6
7
final class Matcher
8
{
9
    private $type;
10
11 1
    public static function forType(string $type): self
12
    {
13 1
        return new static($type);
14
    }
15
16
    /** @var mixed $criteria */
17 1
    public function __invoke($criteria): bool
18
    {
19 1
        return is_a($criteria, $this->type, true);
20
    }
21
22 1
    private function __construct(string $type)
23
    {
24 1
        $this->type = $type;
25 1
    }
26
}
27