From 3d231c88fa299787fe52e00773d03a4efa51590d Mon Sep 17 00:00:00 2001 From: Aleksander Machniak Date: Sun, 8 Jul 2012 10:58:11 +0200 Subject: CS fixes --- program/include/rcube_db.php | 186 ++++++++++++++++++++++--------------------- 1 file changed, 97 insertions(+), 89 deletions(-) (limited to 'program/include/rcube_db.php') diff --git a/program/include/rcube_db.php b/program/include/rcube_db.php index b1cbd8505..f24e95913 100644 --- a/program/include/rcube_db.php +++ b/program/include/rcube_db.php @@ -1,6 +1,6 @@ a_query_results); - $this->last_res_id = $res_id; - $this->a_query_results[$res_id] = $res; + $this->last_res_id = sizeof($this->a_query_results); + $this->a_query_results[$this->last_res_id] = $res; - return $res_id; + return $this->last_res_id; } /** * Resolves a given handle ID and returns the according query handle * If no ID is specified, the last resource handle will be returned * - * @param number $res_id Handle ID + * @param int $res_id Handle ID * - * @return mixed Resource handle or false on failure + * @return mixed Resource handle or false on failure */ protected function _get_result($res_id = null) { @@ -844,7 +846,8 @@ class rcube_db if (($pos = strpos($dsn, '://')) !== false) { $str = substr($dsn, 0, $pos); $dsn = substr($dsn, $pos + 3); - } else { + } + else { $str = $dsn; $dsn = null; } @@ -854,7 +857,8 @@ class rcube_db if (preg_match('|^(.+?)\((.*?)\)$|', $str, $arr)) { $parsed['phptype'] = $arr[1]; $parsed['dbsyntax'] = !$arr[2] ? $arr[1] : $arr[2]; - } else { + } + else { $parsed['phptype'] = $str; $parsed['dbsyntax'] = $str; } @@ -871,7 +875,8 @@ class rcube_db if (($pos = strpos($str, ':')) !== false) { $parsed['username'] = rawurldecode(substr($str, 0, $pos)); $parsed['password'] = rawurldecode(substr($str, $pos + 1)); - } else { + } + else { $parsed['username'] = rawurldecode($str); } } @@ -900,9 +905,11 @@ class rcube_db $pos = strrpos($proto_opts, '/'); $dsn = substr($proto_opts, $pos + 1); $proto_opts = substr($proto_opts, 0, $pos); - } elseif (strpos($dsn, '/') !== false) { + } + else if (strpos($dsn, '/') !== false) { list($proto_opts, $dsn) = explode('/', $dsn, 2); - } else { + } + else { $proto_opts = $dsn; $dsn = null; } @@ -934,7 +941,8 @@ class rcube_db $dsn = substr($dsn, $pos + 1); if (strpos($dsn, '&') !== false) { $opts = explode('&', $dsn); - } else { // database?param1=value1 + } + else { // database?param1=value1 $opts = array($dsn); } foreach ($opts as $opt) { @@ -953,7 +961,7 @@ class rcube_db /** * Returns PDO DSN string from DSN array * - * @param array $dsn DSN parameters + * @param array $dsn DSN parameters * * @return string DSN string */ @@ -984,7 +992,7 @@ class rcube_db /** * Returns driver-specific connection options * - * @param array $dsn DSN parameters + * @param array $dsn DSN parameters * * @return array Connection options */ -- cgit v1.2.3