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
|
|||
18 | [$superClass] = $arguments; |
||
0 ignored issues
–
show
|
|||
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 |
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.