Permalink
Browse files

attempt to make code a bit more readable

  • Loading branch information...
1 parent 0627685 commit 5b2583048230fe776860312370663744e404f478 @basz basz committed Sep 27, 2012
Showing with 3 additions and 6 deletions.
  1. +3 −6 library/Zend/View/Strategy/JsonStrategy.php
@@ -84,23 +84,20 @@ public function selectRenderer(ViewEvent $e)
{
$model = $e->getModel();
- $earlyReturn = $model instanceof Model\JsonModel ? $this->renderer : null;
-
$request = $e->getRequest();
if (!$request instanceof HttpRequest) {
// Not an HTTP request; cannot autodetermine
- return $earlyReturn;
+ return ($model instanceof Model\JsonModel) ? $this->renderer : null;
}
$headers = $request->getHeaders();
if (!$headers->has('accept')) {
- return $earlyReturn;
+ return ($model instanceof Model\JsonModel) ? $this->renderer : null;
}
-
$accept = $headers->get('Accept');
if (($match = $accept->match('application/json, application/javascript')) == false) {
- return $earlyReturn;
+ return ($model instanceof Model\JsonModel) ? $this->renderer : null;
}
if ($match->getTypeString() == 'application/json') {

0 comments on commit 5b25830

Please sign in to comment.