Skip to content

Commit

Permalink
Use early return instead of two if statements
Browse files Browse the repository at this point in the history
- Per feedback from @akrabat
  • Loading branch information
weierophinney committed Dec 19, 2012
1 parent 1682874 commit b43c876
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions library/Zend/Mvc/Controller/AbstractActionController.php
Original file line number Diff line number Diff line change
Expand Up @@ -55,13 +55,9 @@ public function notFoundAction()
$routeMatch->setParam('action', 'not-found');

if ($response instanceof HttpResponse) {
$viewModel = $this->createHttpNotFoundModel($response);
return $this->createHttpNotFoundModel($response);
}
if (!$response instanceof HttpResponse) {
$viewModel = $this->createConsoleNotFoundModel($response);
}

return $viewModel;
return $this->createConsoleNotFoundModel($response);
}

/**
Expand Down

0 comments on commit b43c876

Please sign in to comment.