99 * @author Alexander V. Butenko <a.butenka@gmail.com>
1010 * @copyright Copyright (c) 2010
1111 * @license http://opensource.org/licenses/gpl-3.0.html GNU Public License
12+ * @link http://github.com/joshcam/PHP-MySQLi-Database-Class
1213 * @version 2.2
1314 **/
1415class MysqliDb
@@ -307,7 +308,7 @@ public function rawQuery ($query, $bindParams = null)
307308 $ this ->_query = $ query ;
308309 $ stmt = $ this ->_prepareQuery ();
309310
310- if (is_array ($ bindParams ) === true ) {
311+ if (is_array ($ bindParams ) === true ) {
311312 foreach ($ bindParams as $ prop => $ val ) {
312313 $ params [0 ] .= $ this ->_determineType ($ val );
313314 array_push ($ params , $ bindParams [$ prop ]);
@@ -915,9 +916,8 @@ protected function _dynamicBindResults(mysqli_stmt $stmt)
915916
916917 // if $meta is false yet sqlstate is true, there's no sql error but the query is
917918 // most likely an update/insert/delete which doesn't produce any results
918- if (!$ meta && $ stmt ->sqlstate ) {
919+ if (!$ meta && $ stmt ->sqlstate )
919920 return array ();
920- }
921921
922922 $ row = array ();
923923 while ($ field = $ meta ->fetch_field ()) {
@@ -975,9 +975,8 @@ protected function _dynamicBindResults(mysqli_stmt $stmt)
975975 $ totalCount = $ stmt ->fetch_row ();
976976 $ this ->totalCount = $ totalCount [0 ];
977977 }
978- if ($ this ->returnType == 'Json ' ) {
978+ if ($ this ->returnType == 'Json ' )
979979 return json_encode ($ results );
980- }
981980
982981 return $ results ;
983982 }
@@ -1188,9 +1187,8 @@ protected function _buildLimit ($numRows) {
11881187 */
11891188 protected function _prepareQuery ()
11901189 {
1191- if (!$ stmt = $ this ->mysqli ()->prepare ($ this ->_query )) {
1192- throw new Exception ("Problem preparing query ( $ this ->_query ) " . $ this ->mysqli ()->error );
1193- }
1190+ if (!$ stmt = $ this ->mysqli ()->prepare ($ this ->_query ))
1191+ throw new Exception ("Problem preparing query ( $ this ->_query ) " . $ this ->mysqli ()->error );
11941192 if ($ this ->traceEnabled )
11951193 $ this ->traceStartQ = microtime (true );
11961194
@@ -1218,11 +1216,10 @@ protected function refValues(Array &$arr)
12181216 //Reference in the function arguments are required for HHVM to work
12191217 //https://github.com/facebook/hhvm/issues/5155
12201218 //Referenced data array is required by mysqli since PHP 5.3+
1221- if (strnatcmp (phpversion (), '5.3 ' ) >= 0 ) {
1219+ if (strnatcmp (phpversion (), '5.3 ' ) >= 0 ) {
12221220 $ refs = array ();
1223- foreach ($ arr as $ key => $ value ) {
1221+ foreach ($ arr as $ key => $ value )
12241222 $ refs [$ key ] = & $ arr [$ key ];
1225- }
12261223 return $ refs ;
12271224 }
12281225 return $ arr ;
@@ -1340,9 +1337,8 @@ public function now ($diff = null, $func = "NOW()") {
13401337 * @param int increment by int or float. 1 by default
13411338 */
13421339 public function inc ($ num = 1 ) {
1343- if (!is_numeric ($ num )){
1344- throw new Exception ('Argument supplied to inc must be a number ' );
1345- }
1340+ if (!is_numeric ($ num ))
1341+ throw new Exception ('Argument supplied to inc must be a number ' );
13461342 return Array ("[I] " => "+ " . $ num );
13471343 }
13481344
@@ -1351,9 +1347,8 @@ public function inc($num = 1) {
13511347 * @param int increment by int or float. 1 by default
13521348 */
13531349 public function dec ($ num = 1 ) {
1354- if (!is_numeric ($ num )){
1355- throw new Exception ('Argument supplied to dec must be a number ' );
1356- }
1350+ if (!is_numeric ($ num ))
1351+ throw new Exception ('Argument supplied to dec must be a number ' );
13571352 return Array ("[I] " => "- " . $ num );
13581353 }
13591354
0 commit comments