1 | <?php |
||
10 | final class AdvancedErrorHandler implements ErrorHandlerInterface |
||
11 | { |
||
12 | /** |
||
13 | * @var ContentTypeResolverInterface |
||
14 | */ |
||
15 | private $contentTypeResolver; |
||
16 | |||
17 | /** |
||
18 | * @var ErrorResponseProviderInterface |
||
19 | */ |
||
20 | private $fallbackProvider; |
||
21 | |||
22 | /** |
||
23 | * @var ErrorResponseProviderInterface[] |
||
24 | */ |
||
25 | private $providers = []; |
||
26 | |||
27 | /** |
||
28 | * @param ContentTypeResolverInterface $contentTypeResolver |
||
29 | * @param ErrorResponseProviderInterface $fallbackProvider |
||
30 | * @param array $providers |
||
31 | */ |
||
32 | public function __construct( |
||
44 | |||
45 | /** |
||
46 | * @param ErrorResponseProviderInterface $provider |
||
47 | */ |
||
48 | private function addProvider(ErrorResponseProviderInterface $provider) |
||
52 | |||
53 | /** |
||
54 | * @param Request $request |
||
55 | * @param Response $response |
||
56 | * @param \Exception $exception |
||
57 | * |
||
58 | * @return Response |
||
59 | * |
||
60 | * @throws \LogicException |
||
61 | */ |
||
62 | public function __invoke(Request $request, Response $response, \Exception $exception): Response |
||
72 | } |
||
73 |