| Total Complexity | 5 |
| Total Lines | 32 |
| Duplicated Lines | 0 % |
| Coverage | 100% |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 8 | class ResponseHandlerRegistry |
||
| 9 | { |
||
| 10 | protected $registry = []; |
||
| 11 | |||
| 12 | 1 | public function add(string $name, ResponseHandlerInterface $handler): void |
|
| 13 | { |
||
| 14 | 1 | $this->registry[$name] = $handler; |
|
| 15 | 1 | } |
|
| 16 | |||
| 17 | /** |
||
| 18 | * @throws Exception |
||
| 19 | */ |
||
| 20 | 1 | public function get(string $name): ResponseHandlerInterface |
|
| 27 | } |
||
| 28 | |||
| 29 | 1 | public function has(string $name): bool |
|
| 30 | { |
||
| 31 | 1 | return key_exists($name, $this->registry); |
|
| 32 | } |
||
| 33 | |||
| 34 | /** |
||
| 35 | * @return ResponseHandlerInterface[] |
||
| 36 | */ |
||
| 37 | 1 | public function all(): array |
|
| 40 | } |
||
| 41 | } |
||
| 42 |