| Total Complexity | 3 |
| Total Lines | 30 |
| Duplicated Lines | 0 % |
| Changes | 2 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 19 | final class ErrorHandler implements ErrorInterface |
||
| 20 | { |
||
| 21 | private ResourceObject|null $errorPage = null; |
||
| 22 | |||
| 23 | public function __construct( |
||
| 24 | private TransferInterface $responder, |
||
| 25 | private ErrorLogger $logger, |
||
| 26 | private ErrorPageFactoryInterface $factory, |
||
| 27 | ) { |
||
| 28 | } |
||
| 29 | |||
| 30 | /** |
||
| 31 | * {@inheritDoc} |
||
| 32 | */ |
||
| 33 | #[Override] |
||
| 34 | public function handle(Exception $e, Request $request) // phpcs:ignore SlevomatCodingStandard.Exceptions.ReferenceThrowableOnly.ReferencedGeneralException |
||
| 35 | { |
||
| 36 | ($this->logger)($e, $request); |
||
| 37 | $this->errorPage = $this->factory->newInstance($e, $request); |
||
| 38 | |||
| 39 | return $this; |
||
| 40 | } |
||
| 41 | |||
| 42 | /** |
||
| 43 | * {@inheritDoc} |
||
| 44 | */ |
||
| 45 | #[Override] |
||
| 49 | } |
||
| 50 | } |
||
| 51 |