| Total Complexity | 7 |
| Total Lines | 36 |
| Duplicated Lines | 0 % |
| Coverage | 92.86% |
| Changes | 2 | ||
| Bugs | 0 | Features | 1 |
| 1 | <?php |
||
| 15 | final class Reader |
||
| 16 | { |
||
| 17 | /** @var IAnnotationsReaderEngine[] */ |
||
| 18 | private array $engines = []; |
||
| 19 | |||
| 20 | 1 | public function registerEngine(IAnnotationsReaderEngine $engine): void |
|
| 21 | { |
||
| 22 | 1 | $this->engines[] = $engine; |
|
| 23 | 1 | } |
|
| 24 | |||
| 25 | /** |
||
| 26 | * @param string|object $class |
||
| 27 | */ |
||
| 28 | 1 | public function hasAnnotation(string $name, $class, string $method = null): bool |
|
| 29 | { |
||
| 30 | 1 | foreach ($this->engines as $engine) { |
|
| 31 | 1 | if ($engine->hasAnnotation($name, $class, $method)) { |
|
| 32 | return true; |
||
| 33 | } |
||
| 34 | } |
||
| 35 | 1 | return false; |
|
| 36 | } |
||
| 37 | |||
| 38 | /** |
||
| 39 | * @param string|object $class |
||
| 40 | * @return mixed |
||
| 41 | */ |
||
| 42 | 1 | public function getAnnotation(string $name, $class, string $method = null) |
|
| 51 | } |
||
| 52 | } |
||
| 53 |