IsInMethodMatcher   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 28
Duplicated Lines 0 %

Importance

Changes 3
Bugs 0 Features 0
Metric Value
eloc 4
c 3
b 0
f 0
dl 0
loc 28
rs 10
wmc 2

2 Methods

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