Conditions | 5 |
Paths | 3 |
Total Lines | 11 |
Code Lines | 8 |
Lines | 0 |
Ratio | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 1 |
1 | <?php |
||
10 | public function hasAnnotation(string $name, $class, string $method = null): bool { |
||
11 | if(!$this->isAvailable()) { |
||
12 | return false; |
||
13 | } |
||
14 | $attributeClassName = $this->getClassName($name); |
||
15 | if($method !== null) { |
||
16 | $reflection = new ReflectionMethod(is_object($class) ? get_class($class) : $class, $method); |
||
17 | } else { |
||
18 | $reflection = new \ReflectionClass(is_object($class) ? get_class($class) : $class); |
||
19 | } |
||
20 | return count($reflection->getAttributes($attributeClassName)) > 0; |
||
1 ignored issue
–
show
|
|||
21 | } |
||
48 | ?> |