| Total Complexity | 2 |
| Total Lines | 21 |
| Duplicated Lines | 0 % |
| Coverage | 100% |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 13 | final class ErrorHandlerMiddleware implements MiddlewareInterface |
||
| 14 | { |
||
| 15 | use ErrorHandlerTrait; |
||
| 16 | |||
| 17 | /** |
||
| 18 | * @param ErrorResponseGeneratorInterface|null $responseGenerator |
||
| 19 | */ |
||
| 20 | 13 | public function __construct(?ErrorResponseGeneratorInterface $responseGenerator = null) |
|
| 21 | { |
||
| 22 | 13 | $this->responseGenerator = $responseGenerator ?? new ErrorResponseGenerator(); |
|
| 23 | } |
||
| 24 | |||
| 25 | /** |
||
| 26 | * @param ServerRequestInterface $request |
||
| 27 | * @param RequestHandlerInterface $handler |
||
| 28 | * @return ResponseInterface |
||
| 29 | * @throws ErrorException |
||
| 30 | */ |
||
| 31 | 13 | public function process(ServerRequestInterface $request, RequestHandlerInterface $handler): ResponseInterface |
|
| 34 | } |
||
| 35 | } |
||
| 36 |