Issues (56)

src/IsInMethodMatcher.php (1 issue)

Labels
Severity
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Ray\AuraSqlModule;
6
7
use Override;
0 ignored issues
show
The type Override was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
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
29
        return true;
30
    }
31
32
    /**
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