Skip to content
This repository was archived by the owner on Jan 29, 2020. It is now read-only.

Commit 0cd4135

Browse files
maurice2kMoritz Fain
authored andcommitted
Added PHP 7 cleanup todos
1 parent 1077480 commit 0cd4135

File tree

6 files changed

+8
-8
lines changed

6 files changed

+8
-8
lines changed

src/DispatchListener.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ public function onDispatch(MvcEvent $e)
101101
} catch (\Throwable $exception) {
102102
$return = $this->marshalBadControllerEvent($controllerName, $e, $application, $exception);
103103
return $this->complete($return, $e);
104-
} catch (\Exception $exception) {
104+
} catch (\Exception $exception) { // @TODO clean up once PHP 7 requirement is enforced
105105
$return = $this->marshalBadControllerEvent($controllerName, $e, $application, $exception);
106106
return $this->complete($return, $e);
107107
}
@@ -118,7 +118,7 @@ public function onDispatch(MvcEvent $e)
118118
$return = $controller->dispatch($request, $response);
119119
} catch (\Throwable $ex) {
120120
$caughtException = $ex;
121-
} catch (\Exception $ex) {
121+
} catch (\Exception $ex) { // @TODO clean up once PHP 7 requirement is enforced
122122
$caughtException = $ex;
123123
}
124124

@@ -145,7 +145,7 @@ public function reportMonitorEvent(MvcEvent $e)
145145
{
146146
$error = $e->getError();
147147
$exception = $e->getParam('exception');
148-
if ($exception instanceof \Exception || $exception instanceof \Throwable) {
148+
if ($exception instanceof \Exception || $exception instanceof \Throwable) { // @TODO clean up once PHP 7 requirement is enforced
149149
zend_monitor_custom_event_ex($error, $exception->getMessage(), 'Zend Framework Exception', ['code' => $exception->getCode(), 'trace' => $exception->getTraceAsString()]);
150150
}
151151
}

src/MiddlewareListener.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ public function onDispatch(MvcEvent $event)
6262
$return = $middleware(Psr7Request::fromZend($request), Psr7Response::fromZend($response));
6363
} catch (\Throwable $exception) {
6464
$caughtException = $exception;
65-
} catch (\Exception $exception) {
65+
} catch (\Exception $exception) { // @TODO clean up once PHP 7 requirement is enforced
6666
$caughtException = $exception;
6767
}
6868

src/View/Console/ExceptionStrategy.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -184,7 +184,7 @@ public function prepareExceptionViewModel(MvcEvent $e)
184184
if (is_callable($this->message)) {
185185
$callback = $this->message;
186186
$message = (string) $callback($exception, $this->displayExceptions);
187-
} elseif ($this->displayExceptions && ($exception instanceof \Exception || $exception instanceof \Throwable)) {
187+
} elseif ($this->displayExceptions && ($exception instanceof \Exception || $exception instanceof \Throwable)) { // @TODO clean up once PHP 7 requirement is enforced
188188
$previous = '';
189189
$previousException = $exception->getPrevious();
190190
while ($previousException) {

src/View/Console/RouteNotFoundStrategy.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -460,7 +460,7 @@ protected function reportNotFoundReason($e)
460460
];
461461
$report = sprintf("\nReason for failure: %s\n", $reasons[$reason]);
462462

463-
while ($exception instanceof \Exception || $exception instanceof \Throwable) {
463+
while ($exception instanceof \Exception || $exception instanceof \Throwable) { // @TODO clean up once PHP 7 requirement is enforced
464464
$report .= sprintf("Exception: %s\nTrace:\n%s\n", $exception->getMessage(), $exception->getTraceAsString());
465465
$exception = $exception->getPrevious();
466466
}

src/View/Http/DefaultRenderingStrategy.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ public function render(MvcEvent $e)
105105
$view->render($viewModel);
106106
} catch (\Throwable $ex) {
107107
$caughtException = $ex;
108-
} catch (\Exception $ex) {
108+
} catch (\Exception $ex) { // @TODO clean up once PHP 7 requirement is enforced
109109
$caughtException = $ex;
110110
}
111111

src/View/Http/RouteNotFoundStrategy.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -250,7 +250,7 @@ protected function injectException($model, $e)
250250
$model->setVariable('display_exceptions', true);
251251

252252
$exception = $e->getParam('exception', false);
253-
if (!$exception instanceof \Exception && !$exception instanceof \Throwable) {
253+
if (!$exception instanceof \Exception && !$exception instanceof \Throwable) { // @TODO clean up once PHP 7 requirement is enforced
254254
return;
255255
}
256256

0 commit comments

Comments
 (0)