IsInMethodMatcher::matchesClass()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 2
Bugs 0 Features 0
Metric Value
cc 1
eloc 2
c 2
b 0
f 0
nc 1
nop 2
dl 0
loc 5
rs 10
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