From 8c18b522759c4413d711bc11e802e56667aae318 Mon Sep 17 00:00:00 2001 From: Chuck Hagenbuch Date: Tue, 9 Dec 2008 13:33:49 -0500 Subject: [PATCH] somewhat more straightforward if statements --- framework/Controller/lib/Horde/Controller/Base.php | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/framework/Controller/lib/Horde/Controller/Base.php b/framework/Controller/lib/Horde/Controller/Base.php index 4ca88e4d5..ef8bbdb6d 100644 --- a/framework/Controller/lib/Horde/Controller/Base.php +++ b/framework/Controller/lib/Horde/Controller/Base.php @@ -66,7 +66,9 @@ abstract class Horde_Controller_Base */ protected $_actionMethods = array(); - /** @var string */ + /** + * @var string + */ protected $_viewsDir = ''; /** @@ -191,25 +193,26 @@ abstract class Horde_Controller_Base // validate options // set response status - if ($status = !empty($options['status']) ? $options['status'] : null) { - $header = $this->interpretStatus($status); + if (!empty($options['status'])) { + $header = $this->interpretStatus($options['status']); $this->_response->setStatus($header); } // set response location - if ($location = !empty($options['location']) ? $options['location'] : null) { - $url = $this->urlFor($location); + if (!empty($options['location'])) { + $url = $this->urlFor($options['location']); $this->_response->setHeader("Location: $url", $replace = true); } // render text - if ($text = !empty($options['text']) ? $options['text'] : null) { - $this->renderText($text); + if (!empty($options['text'])) { + $this->renderText($options['text']); // render xml - } elseif ($xml = !empty($options['xml']) ? $options['xml'] : null) { + } elseif (!empty($options['xml'])) { $this->_response->setContentType('application/xml'); + $xml = $options['xml']; if (is_object($xml) && method_exists($xml, 'toXml')) { $xml = $xml->toXml(); } -- 2.11.0