LogicalNotMatcher::matchesMethod()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 3
CRAP Score 1

Importance

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