From 5645479c622eb36cf9869797896dc0921568c4a9 Mon Sep 17 00:00:00 2001 From: Andrey Andreev Date: Thu, 17 May 2012 14:32:19 +0300 Subject: Clean up the libraries --- system/libraries/Parser.php | 26 ++++++++------------------ 1 file changed, 8 insertions(+), 18 deletions(-) (limited to 'system/libraries/Parser.php') diff --git a/system/libraries/Parser.php b/system/libraries/Parser.php index c40f339b4..a0b60ed97 100644 --- a/system/libraries/Parser.php +++ b/system/libraries/Parser.php @@ -42,14 +42,14 @@ class CI_Parser { * @var string */ public $l_delim = '{'; - + /** * Right delimeter character for psuedo vars * * @var string */ public $r_delim = '}'; - + /** * Reference to CodeIgniter instance * @@ -116,14 +116,9 @@ class CI_Parser { foreach ($data as $key => $val) { - if (is_array($val)) - { - $template = $this->_parse_pair($key, $val, $template); - } - else - { - $template = $this->_parse_single($key, (string)$val, $template); - } + $template = is_array($val) + ? $this->_parse_pair($key, $val, $template) + : $template = $this->_parse_single($key, (string) $val, $template); } if ($return == FALSE) @@ -189,14 +184,9 @@ class CI_Parser { $temp = $match[1]; foreach ($row as $key => $val) { - if ( ! is_array($val)) - { - $temp = $this->_parse_single($key, $val, $temp); - } - else - { - $temp = $this->_parse_pair($key, $val, $temp); - } + $temp = is_array($val) + ? $this->_parse_pair($key, $val, $temp) + : $this->_parse_single($key, $val, $temp); } $str .= $temp; -- cgit v1.2.3-24-g4f1b From d261b1e89c3d4d5191036d5a5660ef6764e593a0 Mon Sep 17 00:00:00 2001 From: Alex Bilbie Date: Sat, 2 Jun 2012 11:12:16 +0100 Subject: Replaced `==` with `===` and `!=` with `!==` in /system/libraries --- system/libraries/Parser.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'system/libraries/Parser.php') diff --git a/system/libraries/Parser.php b/system/libraries/Parser.php index a0b60ed97..b64c78254 100644 --- a/system/libraries/Parser.php +++ b/system/libraries/Parser.php @@ -109,7 +109,7 @@ class CI_Parser { */ protected function _parse($template, $data, $return = FALSE) { - if ($template == '') + if ($template === '') { return FALSE; } @@ -121,7 +121,7 @@ class CI_Parser { : $template = $this->_parse_single($key, (string) $val, $template); } - if ($return == FALSE) + if ($return === FALSE) { $this->CI->output->append_output($template); } -- cgit v1.2.3-24-g4f1b