Total Complexity | 2 |
Total Lines | 20 |
Duplicated Lines | 0 % |
Coverage | 100% |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
7 | final class Handlers |
||
8 | { |
||
9 | /** @var array<class-string, callable> */ |
||
|
|||
10 | private array $handlers = []; |
||
11 | |||
12 | /** |
||
13 | * @param class-string $exception |
||
14 | */ |
||
15 | 1 | public function handle(string $exception, callable $handler): self |
|
16 | { |
||
17 | 1 | $this->handlers[$exception] = $handler; |
|
18 | 1 | return $this; |
|
19 | } |
||
20 | |||
21 | /** |
||
22 | * @return array<class-string, callable> |
||
23 | */ |
||
24 | 2 | public function getAllHandlers(): array |
|
27 | } |
||
28 | } |
||
29 |