Completed
Push — 2.x ( ae114c...98cb65 )
by Akihito
27s queued 11s
created

src/Matcher/SubclassesOfMatcher.php (2 issues)

Upgrade to new PHP Analysis Engine

These results are based on our legacy PHP analysis, consider migrating to our new PHP analysis engine instead. Learn more

1
<?php
2
3
declare(strict_types=1);
4
5
namespace Ray\Aop\Matcher;
6
7
use Ray\Aop\AbstractMatcher;
8
use Ray\Aop\Exception\InvalidAnnotationException;
9
10
final class SubclassesOfMatcher extends AbstractMatcher
11
{
12
    /**
13
     * {@inheritdoc}
14
     */
15
    public function matchesClass(\ReflectionClass $class, array $arguments) : bool
16
    {
17
        /** @var array<class-string> $arguments */
0 ignored issues
show
The doc-type array<class-string> could not be parsed: Unknown type name "class-string" at position 6. (view supported doc-types)

This check marks PHPDoc comments that could not be parsed by our parser. To see which comment annotations we can parse, please refer to our documentation on supported doc-types.

Loading history...
18
        [$superClass] = $arguments;
0 ignored issues
show
The variable $superClass does not exist. Did you forget to declare it?

This check marks access to variables or properties that have not been declared yet. While PHP has no explicit notion of declaring a variable, accessing it before a value is assigned to it is most likely a bug.

Loading history...
19 1
20
        return $class->isSubclassOf($superClass) || ($class->name === $superClass);
21 1
    }
22 1
23
    /**
24 1
     * {@inheritdoc}
25
     */
26
    public function matchesMethod(\ReflectionMethod $method, array $arguments) : bool
27
    {
28
        unset($method, $arguments);
29
30 1
        throw new InvalidAnnotationException('subclassesOf is only for class match');
31
    }
32
}
33