LogicalNotMatcher   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 22
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 2
eloc 6
c 0
b 0
f 0
dl 0
loc 22
ccs 7
cts 7
cp 1
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A matchesMethod() 0 6 1
A matchesClass() 0 6 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Ray\Aop\Matcher;
6
7
use Ray\Aop\AbstractMatcher;
8
use ReflectionClass;
9
use ReflectionMethod;
10
11
use function assert;
12
13
final class LogicalNotMatcher extends AbstractMatcher
14
{
15
    /**
16
     * {@inheritdoc}
17
     */
18 2
    public function matchesClass(ReflectionClass $class, array $arguments): bool
19
    {
20 2
        [$matcher] = $arguments;
21
        assert($matcher instanceof AbstractMatcher);
22 2
23
        return ! $matcher->matchesClass($class, $matcher->getArguments());
24 2
    }
25
26
    /**
27
     * {@inheritdoc}
28
     */
29
    public function matchesMethod(ReflectionMethod $method, array $arguments): bool
30 1
    {
31
        [$matcher] = $arguments;
32 1
        assert($matcher instanceof AbstractMatcher);
33
34 1
        return ! $matcher->matchesMethod($method, $matcher->getArguments());
35
    }
36
}
37