@@ -45,7 +45,7 @@ discard block |
||
| 45 | 45 | bool $suppressErrors, |
| 46 | 46 | RendererInterface $renderer, |
| 47 | 47 | SnapshotterInterface $snapshots = null |
| 48 | - ) { |
|
| 48 | + ){ |
|
| 49 | 49 | $this->suppressErrors = $suppressErrors; |
| 50 | 50 | $this->renderer = $renderer; |
| 51 | 51 | $this->snapshots = $snapshots; |
@@ -58,20 +58,20 @@ discard block |
||
| 58 | 58 | */ |
| 59 | 59 | public function process(Request $request, Handler $handler): Response |
| 60 | 60 | { |
| 61 | - try { |
|
| 61 | + try{ |
|
| 62 | 62 | return $handler->handle($request); |
| 63 | - } catch (ClientException | RouterException $e) { |
|
| 64 | - if ($e instanceof ClientException) { |
|
| 63 | + }catch (ClientException | RouterException $e){ |
|
| 64 | + if ($e instanceof ClientException){ |
|
| 65 | 65 | $code = $e->getCode(); |
| 66 | - } else { |
|
| 66 | + }else{ |
|
| 67 | 67 | $code = 404; |
| 68 | 68 | } |
| 69 | - } catch (\Throwable $e) { |
|
| 70 | - if (!$this->suppressErrors) { |
|
| 69 | + }catch (\Throwable $e){ |
|
| 70 | + if (!$this->suppressErrors){ |
|
| 71 | 71 | throw $e; |
| 72 | 72 | } |
| 73 | 73 | |
| 74 | - if ($this->snapshots !== null) { |
|
| 74 | + if ($this->snapshots !== null){ |
|
| 75 | 75 | $this->snapshots->register($e); |
| 76 | 76 | } |
| 77 | 77 | |
@@ -58,20 +58,30 @@ |
||
| 58 | 58 | */ |
| 59 | 59 | public function process(Request $request, Handler $handler): Response |
| 60 | 60 | { |
| 61 | - try { |
|
| 61 | + try |
|
| 62 | + { |
|
| 62 | 63 | return $handler->handle($request); |
| 63 | - } catch (ClientException | RouterException $e) { |
|
| 64 | - if ($e instanceof ClientException) { |
|
| 64 | + } |
|
| 65 | + catch (ClientException | RouterException $e) |
|
| 66 | + { |
|
| 67 | + if ($e instanceof ClientException) |
|
| 68 | + { |
|
| 65 | 69 | $code = $e->getCode(); |
| 66 | - } else { |
|
| 70 | + } |
|
| 71 | + else |
|
| 72 | + { |
|
| 67 | 73 | $code = 404; |
| 68 | 74 | } |
| 69 | - } catch (\Throwable $e) { |
|
| 70 | - if (!$this->suppressErrors) { |
|
| 75 | + } |
|
| 76 | + catch (\Throwable $e) |
|
| 77 | + { |
|
| 78 | + if (!$this->suppressErrors) |
|
| 79 | + { |
|
| 71 | 80 | throw $e; |
| 72 | 81 | } |
| 73 | 82 | |
| 74 | - if ($this->snapshots !== null) { |
|
| 83 | + if ($this->snapshots !== null) |
|
| 84 | + { |
|
| 75 | 85 | $this->snapshots->register($e); |
| 76 | 86 | } |
| 77 | 87 | |