| @@ 66-87 (lines=22) @@ | ||
| 63 | * @param RequestHandlerInterface $handler Request handler |
|
| 64 | * @return ResponseInterface |
|
| 65 | */ |
|
| 66 | public function process(ServerRequestInterface $request, RequestHandlerInterface $handler) : ResponseInterface |
|
| 67 | { |
|
| 68 | try { |
|
| 69 | $response = $handler->handle($request); |
|
| 70 | return $response; |
|
| 71 | } |
|
| 72 | // Executed only in PHP 7, will not match in PHP 5.x |
|
| 73 | catch (\Throwable $e) |
|
| 74 | { |
|
| 75 | $this->handleThrowable( $e ); |
|
| 76 | throw $e; |
|
| 77 | } |
|
| 78 | ||
| 79 | // Executed only in PHP 5.x, will not be reached in PHP 7 |
|
| 80 | catch (\Exception $e) |
|
| 81 | { |
|
| 82 | $this->handleThrowable( $e ); |
|
| 83 | throw $e; |
|
| 84 | } |
|
| 85 | ||
| 86 | ||
| 87 | } |
|
| 88 | ||
| 89 | ||
| 90 | ||
| @@ 103-126 (lines=24) @@ | ||
| 100 | * |
|
| 101 | * @return ResponseInterface |
|
| 102 | */ |
|
| 103 | public function __invoke(RequestInterface $request, ResponseInterface $response, callable $next) |
|
| 104 | { |
|
| 105 | try |
|
| 106 | { |
|
| 107 | // Try to do business as usual... |
|
| 108 | return $next($request, $response); |
|
| 109 | } |
|
| 110 | ||
| 111 | // Executed only in PHP 7, will not match in PHP 5.x |
|
| 112 | catch (\Throwable $e) |
|
| 113 | { |
|
| 114 | $this->handleThrowable( $e ); |
|
| 115 | throw $e; |
|
| 116 | } |
|
| 117 | ||
| 118 | // Executed only in PHP 5.x, will not be reached in PHP 7 |
|
| 119 | catch (\Exception $e) |
|
| 120 | { |
|
| 121 | $this->handleThrowable( $e ); |
|
| 122 | throw $e; |
|
| 123 | } |
|
| 124 | ||
| 125 | // Anything else NOT caught here will bubble up. |
|
| 126 | } |
|
| 127 | ||
| 128 | ||
| 129 | /** |
|
| @@ 40-61 (lines=22) @@ | ||
| 37 | * @param RequestHandlerInterface $handler Request handler |
|
| 38 | * @return ResponseInterface |
|
| 39 | */ |
|
| 40 | public function process(ServerRequestInterface $request, RequestHandlerInterface $handler) : ResponseInterface |
|
| 41 | { |
|
| 42 | try { |
|
| 43 | $response = $handler->handle($request); |
|
| 44 | return $response; |
|
| 45 | } |
|
| 46 | // Executed only in PHP 7, will not match in PHP 5.x |
|
| 47 | catch (\Throwable $e) |
|
| 48 | { |
|
| 49 | $this->handleThrowable( $e ); |
|
| 50 | throw $e; |
|
| 51 | } |
|
| 52 | ||
| 53 | // Executed only in PHP 5.x, will not be reached in PHP 7 |
|
| 54 | catch (\Exception $e) |
|
| 55 | { |
|
| 56 | $this->handleThrowable( $e ); |
|
| 57 | throw $e; |
|
| 58 | } |
|
| 59 | ||
| 60 | ||
| 61 | } |
|
| 62 | ||
| 63 | ||
| 64 | ||
| @@ 74-95 (lines=22) @@ | ||
| 71 | * |
|
| 72 | * @return ResponseInterface |
|
| 73 | */ |
|
| 74 | public function __invoke(RequestInterface $request, ResponseInterface $response, callable $next) |
|
| 75 | { |
|
| 76 | try |
|
| 77 | { |
|
| 78 | // Try to do business as usual... |
|
| 79 | return $next($request, $response); |
|
| 80 | } |
|
| 81 | ||
| 82 | // Executed only in PHP 7, will not match in PHP 5.x |
|
| 83 | catch (\Throwable $e) |
|
| 84 | { |
|
| 85 | $this->handleThrowable( $e ); |
|
| 86 | throw $e; |
|
| 87 | } |
|
| 88 | ||
| 89 | // Executed only in PHP 5.x, will not be reached in PHP 7 |
|
| 90 | catch (\Exception $e) |
|
| 91 | { |
|
| 92 | $this->handleThrowable( $e ); |
|
| 93 | throw $e; |
|
| 94 | } |
|
| 95 | } |
|
| 96 | ||
| 97 | ||
| 98 | /** |
|