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