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

Commit

Permalink
Added PHP 7 cleanup todos
Browse files Browse the repository at this point in the history
  • Loading branch information
maurice2k authored and Moritz Fain committed May 3, 2016
1 parent 1077480 commit 0cd4135
Show file tree
Hide file tree
Showing 6 changed files with 8 additions and 8 deletions.
6 changes: 3 additions & 3 deletions src/DispatchListener.php
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ public function onDispatch(MvcEvent $e)
} catch (\Throwable $exception) {
$return = $this->marshalBadControllerEvent($controllerName, $e, $application, $exception);
return $this->complete($return, $e);
} catch (\Exception $exception) {
} catch (\Exception $exception) { // @TODO clean up once PHP 7 requirement is enforced
$return = $this->marshalBadControllerEvent($controllerName, $e, $application, $exception);
return $this->complete($return, $e);
}
Expand All @@ -118,7 +118,7 @@ public function onDispatch(MvcEvent $e)
$return = $controller->dispatch($request, $response);
} catch (\Throwable $ex) {
$caughtException = $ex;
} catch (\Exception $ex) {
} catch (\Exception $ex) { // @TODO clean up once PHP 7 requirement is enforced
$caughtException = $ex;
}

Expand All @@ -145,7 +145,7 @@ public function reportMonitorEvent(MvcEvent $e)
{
$error = $e->getError();
$exception = $e->getParam('exception');
if ($exception instanceof \Exception || $exception instanceof \Throwable) {
if ($exception instanceof \Exception || $exception instanceof \Throwable) { // @TODO clean up once PHP 7 requirement is enforced
zend_monitor_custom_event_ex($error, $exception->getMessage(), 'Zend Framework Exception', ['code' => $exception->getCode(), 'trace' => $exception->getTraceAsString()]);
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/MiddlewareListener.php
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ public function onDispatch(MvcEvent $event)
$return = $middleware(Psr7Request::fromZend($request), Psr7Response::fromZend($response));
} catch (\Throwable $exception) {
$caughtException = $exception;
} catch (\Exception $exception) {
} catch (\Exception $exception) { // @TODO clean up once PHP 7 requirement is enforced
$caughtException = $exception;
}

Expand Down
2 changes: 1 addition & 1 deletion src/View/Console/ExceptionStrategy.php
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ public function prepareExceptionViewModel(MvcEvent $e)
if (is_callable($this->message)) {
$callback = $this->message;
$message = (string) $callback($exception, $this->displayExceptions);
} elseif ($this->displayExceptions && ($exception instanceof \Exception || $exception instanceof \Throwable)) {
} elseif ($this->displayExceptions && ($exception instanceof \Exception || $exception instanceof \Throwable)) { // @TODO clean up once PHP 7 requirement is enforced
$previous = '';
$previousException = $exception->getPrevious();
while ($previousException) {
Expand Down
2 changes: 1 addition & 1 deletion src/View/Console/RouteNotFoundStrategy.php
Original file line number Diff line number Diff line change
Expand Up @@ -460,7 +460,7 @@ protected function reportNotFoundReason($e)
];
$report = sprintf("\nReason for failure: %s\n", $reasons[$reason]);

while ($exception instanceof \Exception || $exception instanceof \Throwable) {
while ($exception instanceof \Exception || $exception instanceof \Throwable) { // @TODO clean up once PHP 7 requirement is enforced
$report .= sprintf("Exception: %s\nTrace:\n%s\n", $exception->getMessage(), $exception->getTraceAsString());
$exception = $exception->getPrevious();
}
Expand Down
2 changes: 1 addition & 1 deletion src/View/Http/DefaultRenderingStrategy.php
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ public function render(MvcEvent $e)
$view->render($viewModel);
} catch (\Throwable $ex) {
$caughtException = $ex;
} catch (\Exception $ex) {
} catch (\Exception $ex) { // @TODO clean up once PHP 7 requirement is enforced
$caughtException = $ex;
}

Expand Down
2 changes: 1 addition & 1 deletion src/View/Http/RouteNotFoundStrategy.php
Original file line number Diff line number Diff line change
Expand Up @@ -250,7 +250,7 @@ protected function injectException($model, $e)
$model->setVariable('display_exceptions', true);

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

Expand Down

0 comments on commit 0cd4135

Please sign in to comment.