@@ -57,12 +57,12 @@ discard block |
||
| 57 | 57 | $http = $this->container->get(Http::class); |
| 58 | 58 | $emitter = $emitter ?? $this->container->get(EmitterInterface::class); |
| 59 | 59 | |
| 60 | - try { |
|
| 60 | + try{ |
|
| 61 | 61 | $response = $http->handle($this->initRequest()); |
| 62 | 62 | $emitter->emit($response); |
| 63 | - } catch (\Throwable $e) { |
|
| 63 | + }catch (\Throwable $e){ |
|
| 64 | 64 | $this->handleException($emitter, $e); |
| 65 | - } finally { |
|
| 65 | + }finally{ |
|
| 66 | 66 | $this->finalizer->finalize(false); |
| 67 | 67 | } |
| 68 | 68 | } |
@@ -83,10 +83,10 @@ discard block |
||
| 83 | 83 | { |
| 84 | 84 | $handler = new HtmlHandler(HtmlHandler::DEFAULT); |
| 85 | 85 | |
| 86 | - try { |
|
| 86 | + try{ |
|
| 87 | 87 | /** @var SnapshotInterface $snapshot */ |
| 88 | 88 | $this->container->get(SnapshotterInterface::class)->register($e); |
| 89 | - } catch (\Throwable|ContainerExceptionInterface $se) { |
|
| 89 | + }catch (\Throwable | ContainerExceptionInterface $se){ |
|
| 90 | 90 | // nothing to report |
| 91 | 91 | } |
| 92 | 92 | |
@@ -57,12 +57,17 @@ discard block |
||
| 57 | 57 | $http = $this->container->get(Http::class); |
| 58 | 58 | $emitter = $emitter ?? $this->container->get(EmitterInterface::class); |
| 59 | 59 | |
| 60 | - try { |
|
| 60 | + try |
|
| 61 | + { |
|
| 61 | 62 | $response = $http->handle($this->initRequest()); |
| 62 | 63 | $emitter->emit($response); |
| 63 | - } catch (\Throwable $e) { |
|
| 64 | + } |
|
| 65 | + catch (\Throwable $e) |
|
| 66 | + { |
|
| 64 | 67 | $this->handleException($emitter, $e); |
| 65 | - } finally { |
|
| 68 | + } |
|
| 69 | + finally |
|
| 70 | + { |
|
| 66 | 71 | $this->finalizer->finalize(false); |
| 67 | 72 | } |
| 68 | 73 | } |
@@ -83,10 +88,13 @@ discard block |
||
| 83 | 88 | { |
| 84 | 89 | $handler = new HtmlHandler(HtmlHandler::DEFAULT); |
| 85 | 90 | |
| 86 | - try { |
|
| 91 | + try |
|
| 92 | + { |
|
| 87 | 93 | /** @var SnapshotInterface $snapshot */ |
| 88 | 94 | $this->container->get(SnapshotterInterface::class)->register($e); |
| 89 | - } catch (\Throwable|ContainerExceptionInterface $se) { |
|
| 95 | + } |
|
| 96 | + catch (\Throwable|ContainerExceptionInterface $se) |
|
| 97 | + { |
|
| 90 | 98 | // nothing to report |
| 91 | 99 | } |
| 92 | 100 | |
@@ -81,7 +81,7 @@ |
||
| 81 | 81 | */ |
| 82 | 82 | protected function handleException(EmitterInterface $emitter, \Throwable $e) |
| 83 | 83 | { |
| 84 | - $handler = new HtmlHandler(HtmlHandler::DEFAULT); |
|
| 84 | + $handler = new HtmlHandler(HtmlHandler::default); |
|
| 85 | 85 | |
| 86 | 86 | try { |
| 87 | 87 | /** @var SnapshotInterface $snapshot */ |
@@ -46,7 +46,7 @@ discard block |
||
| 46 | 46 | FinalizerInterface $finalizer, |
| 47 | 47 | ContainerInterface $container, |
| 48 | 48 | FactoryInterface $factory |
| 49 | - ) { |
|
| 49 | + ){ |
|
| 50 | 50 | $this->env = $env; |
| 51 | 51 | $this->finalizer = $finalizer; |
| 52 | 52 | $this->container = $container; |
@@ -70,12 +70,12 @@ discard block |
||
| 70 | 70 | |
| 71 | 71 | /** @var Http $http */ |
| 72 | 72 | $http = $this->container->get(Http::class); |
| 73 | - while ($request = $client->acceptRequest()) { |
|
| 74 | - try { |
|
| 73 | + while ($request = $client->acceptRequest()){ |
|
| 74 | + try{ |
|
| 75 | 75 | $client->respond($http->handle($request)); |
| 76 | - } catch (\Throwable $e) { |
|
| 76 | + }catch (\Throwable $e){ |
|
| 77 | 77 | $this->handleException($client, $e); |
| 78 | - } finally { |
|
| 78 | + }finally{ |
|
| 79 | 79 | $this->finalizer->finalize(false); |
| 80 | 80 | } |
| 81 | 81 | } |
@@ -89,11 +89,11 @@ discard block |
||
| 89 | 89 | { |
| 90 | 90 | $handler = new HtmlHandler(HtmlHandler::DEFAULT); |
| 91 | 91 | |
| 92 | - try { |
|
| 92 | + try{ |
|
| 93 | 93 | /** @var SnapshotInterface $snapshot */ |
| 94 | 94 | $snapshot = $this->container->get(SnapshotterInterface::class)->register($e); |
| 95 | 95 | error_log($snapshot->getMessage()); |
| 96 | - } catch (\Throwable|ContainerExceptionInterface $se) { |
|
| 96 | + }catch (\Throwable | ContainerExceptionInterface $se){ |
|
| 97 | 97 | error_log((string)$e); |
| 98 | 98 | } |
| 99 | 99 | |
@@ -70,12 +70,18 @@ discard block |
||
| 70 | 70 | |
| 71 | 71 | /** @var Http $http */ |
| 72 | 72 | $http = $this->container->get(Http::class); |
| 73 | - while ($request = $client->acceptRequest()) { |
|
| 74 | - try { |
|
| 73 | + while ($request = $client->acceptRequest()) |
|
| 74 | + { |
|
| 75 | + try |
|
| 76 | + { |
|
| 75 | 77 | $client->respond($http->handle($request)); |
| 76 | - } catch (\Throwable $e) { |
|
| 78 | + } |
|
| 79 | + catch (\Throwable $e) |
|
| 80 | + { |
|
| 77 | 81 | $this->handleException($client, $e); |
| 78 | - } finally { |
|
| 82 | + } |
|
| 83 | + finally |
|
| 84 | + { |
|
| 79 | 85 | $this->finalizer->finalize(false); |
| 80 | 86 | } |
| 81 | 87 | } |
@@ -89,11 +95,14 @@ discard block |
||
| 89 | 95 | { |
| 90 | 96 | $handler = new HtmlHandler(HtmlHandler::DEFAULT); |
| 91 | 97 | |
| 92 | - try { |
|
| 98 | + try |
|
| 99 | + { |
|
| 93 | 100 | /** @var SnapshotInterface $snapshot */ |
| 94 | 101 | $snapshot = $this->container->get(SnapshotterInterface::class)->register($e); |
| 95 | 102 | error_log($snapshot->getMessage()); |
| 96 | - } catch (\Throwable|ContainerExceptionInterface $se) { |
|
| 103 | + } |
|
| 104 | + catch (\Throwable|ContainerExceptionInterface $se) |
|
| 105 | + { |
|
| 97 | 106 | error_log((string)$e); |
| 98 | 107 | } |
| 99 | 108 | |
@@ -87,7 +87,7 @@ |
||
| 87 | 87 | */ |
| 88 | 88 | protected function handleException(PSR7Client $client, \Throwable $e) |
| 89 | 89 | { |
| 90 | - $handler = new HtmlHandler(HtmlHandler::DEFAULT); |
|
| 90 | + $handler = new HtmlHandler(HtmlHandler::default); |
|
| 91 | 91 | |
| 92 | 92 | try { |
| 93 | 93 | /** @var SnapshotInterface $snapshot */ |