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