Conditions | 2 |
Paths | 2 |
Total Lines | 9 |
Code Lines | 5 |
Lines | 0 |
Ratio | 0 % |
Tests | 6 |
CRAP Score | 2 |
Changes | 3 | ||
Bugs | 0 | Features | 1 |
1 | <?php |
||
26 | 1 | public function getAnnotation(string $name, string|object $class, string $method = null): mixed |
|
27 | { |
||
28 | 1 | $attributes = $this->getReflection($class, $method)->getAttributes($this->getClassName($name)); |
|
29 | 1 | if (count($attributes) === 0) { |
|
30 | 1 | return null; |
|
31 | } |
||
32 | /** @var BaseAttribute $attribute */ |
||
33 | 1 | $attribute = $attributes[0]->newInstance(); |
|
34 | 1 | return $attribute->value; |
|
35 | } |
||
55 |