IsInMethodMatcher   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 30
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 3
Bugs 0 Features 0
Metric Value
eloc 6
c 3
b 0
f 0
dl 0
loc 30
ccs 3
cts 3
cp 1
rs 10
wmc 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A matchesClass() 0 6 1
A matchesMethod() 0 7 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Ray\AuraSqlModule;
6
7
use Override;
8
use Ray\Aop\AbstractMatcher;
9
use ReflectionClass;
10
use ReflectionMethod;
11
12
use function in_array;
13
14
final class IsInMethodMatcher extends AbstractMatcher
15
{
16
    /**
17
     * {@inheritDoc}
18
     *
19
     * @phpstan-param ReflectionClass<object> $class
20
     * @phpstan-param array<mixed> $arguments
21
     *
22
     * @codeCoverageIgnore
23
     */
24
    #[Override]
25
    public function matchesClass(ReflectionClass $class, array $arguments): bool
26
    {
27
        unset($class, $arguments);
28 3
29
        return true;
30 3
    }
31
32 3
    /**
33
     * {@inheritDoc}
34
     *
35
     * @phpstan-param array<mixed> $arguments
36
     */
37
    #[Override]
38
    public function matchesMethod(ReflectionMethod $method, array $arguments): bool
39
    {
40
        /** @var array<mixed> $firstArg */
41
        $firstArg = $arguments[0];
42
43
        return in_array($method->name, $firstArg, true);
44
    }
45
}
46