Conditions | 5 |
Paths | 4 |
Total Lines | 15 |
Code Lines | 8 |
Lines | 0 |
Ratio | 0 % |
Tests | 7 |
CRAP Score | 5 |
Changes | 0 |
1 | <?php |
||
49 | 2079 | public function getAnnotations(string $name, $holder): Generator |
|
50 | { |
||
51 | // @codeCoverageIgnoreStart |
||
52 | if (PHP_MAJOR_VERSION < 8) { |
||
53 | return; |
||
54 | } // @codeCoverageIgnoreEnd |
||
55 | |||
56 | 2079 | if (! $holder instanceof ReflectionProperty && |
|
57 | 2079 | ! $holder instanceof ReflectionParameter) { |
|
58 | 10 | return; |
|
59 | } |
||
60 | |||
61 | 2069 | $attributes = $holder->getAttributes($name, ReflectionAttribute::IS_INSTANCEOF); |
|
62 | 2069 | foreach ($attributes as $attribute) { |
|
63 | 124 | yield $attribute->newInstance(); |
|
64 | } |
||
67 |