From 48120ce4036d185f6bef808af64f85d842e1214e Mon Sep 17 00:00:00 2001 From: Taylor Otwell Date: Sun, 14 Aug 2011 22:49:28 -0500 Subject: [PATCH] refactoring the response class. --- system/response.php | 15 +++------------ 1 file changed, 3 insertions(+), 12 deletions(-) diff --git a/system/response.php b/system/response.php index 3a3f7dd6..b756e6ed 100644 --- a/system/response.php +++ b/system/response.php @@ -121,10 +121,7 @@ public static function error($code, $data = array()) */ public static function prepare($response) { - if ($response instanceof Redirect) - { - $response = $response->response; - } + if ($response instanceof Redirect) $response = $response->response; return ( ! $response instanceof Response) ? new static($response) : $response; } @@ -136,15 +133,9 @@ public static function prepare($response) */ public function send() { - if ( ! array_key_exists('Content-Type', $this->headers)) - { - $this->header('Content-Type', 'text/html; charset=utf-8'); - } + if ( ! array_key_exists('Content-Type', $this->headers)) $this->header('Content-Type', 'text/html; charset=utf-8') - if ( ! headers_sent()) - { - $this->send_headers(); - } + if ( ! headers_sent()) $this->send_headers(); echo (string) $this->content; }