| 1 | <?php |
||
| 6 | class ErrorResponder extends ResponderDecoratorAbstract implements ResponderInterface |
||
| 7 | { |
||
| 8 | |||
| 9 | public $debug = false; |
||
| 10 | |||
| 11 | |||
| 12 | /** |
||
| 13 | * @param bool|boolean $debug Whether to turn on debug mode |
||
| 14 | * @param ResponderInterface $responder Inner ResponderInterface |
||
| 15 | */ |
||
| 16 | 2 | public function __construct( bool $debug, ResponderInterface $responder ) |
|
| 21 | |||
| 22 | |||
| 23 | /** |
||
| 24 | * Sets the debug mode. |
||
| 25 | * @param bool $debug |
||
| 26 | */ |
||
| 27 | 10 | public function setDebug(bool $debug) { |
|
| 31 | |||
| 32 | |||
| 33 | /** |
||
| 34 | * @inheritDoc |
||
| 35 | */ |
||
| 36 | public function __invoke( $e, int $status = 500 ) : ResponseInterface |
||
| 40 | |||
| 41 | |||
| 42 | /** |
||
| 43 | * @inheritDoc |
||
| 44 | */ |
||
| 45 | 10 | public function createResponse( $e, int $status = 500 ) : ResponseInterface |
|
| 65 | |||
| 66 | |||
| 67 | |||
| 68 | 8 | protected function throwableToArray (\Throwable $e) : array |
|
| 81 | } |
||
| 82 |