Completed
Push — master ( 9bbc25...52f1a7 )
by Lars
02:17
created
src/voku/db/Helper.php 1 patch
Spacing   +17 added lines, -17 removed lines patch added patch discarded remove patch
@@ -120,23 +120,23 @@  discard block
 block discarded – undo
120 120
 
121 121
     $whereSQL = $dbConnection->_parseArrayPair($whereArray, 'AND');
122 122
     if ($whereSQL) {
123
-      $whereSQL = 'AND ' . $whereSQL;
123
+      $whereSQL = 'AND '.$whereSQL;
124 124
     }
125 125
 
126 126
     if ($databaseName) {
127
-      $databaseName = $dbConnection->quote_string(trim($databaseName)) . '.';
127
+      $databaseName = $dbConnection->quote_string(trim($databaseName)).'.';
128 128
     }
129 129
 
130 130
     // get the row
131
-    $query = 'SELECT ' . $dbConnection->quote_string($searchFieldName) . ', ' . $dbConnection->quote_string($idFieldName) . ' 
132
-      FROM ' . $databaseName . $dbConnection->quote_string($table) . '
131
+    $query = 'SELECT '.$dbConnection->quote_string($searchFieldName).', '.$dbConnection->quote_string($idFieldName).' 
132
+      FROM ' . $databaseName.$dbConnection->quote_string($table).'
133 133
       WHERE 1 = 1
134
-      ' . $whereSQL . '
134
+      ' . $whereSQL.'
135 135
     ';
136 136
 
137 137
     if ($useCache === true) {
138 138
       $cache = new Cache(null, null, false, $useCache);
139
-      $cacheKey = 'sql-phonetic-search-' . md5($query);
139
+      $cacheKey = 'sql-phonetic-search-'.md5($query);
140 140
 
141 141
       if (
142 142
           $cache->getCacheIsReady() === true
@@ -266,10 +266,10 @@  discard block
 block discarded – undo
266 266
     }
267 267
 
268 268
     if ($databaseName) {
269
-      $databaseName = $dbConnection->quote_string(trim($databaseName)) . '.';
269
+      $databaseName = $dbConnection->quote_string(trim($databaseName)).'.';
270 270
     }
271 271
 
272
-    $sql = 'SHOW COLUMNS FROM ' . $databaseName . $dbConnection->escape($table);
272
+    $sql = 'SHOW COLUMNS FROM '.$databaseName.$dbConnection->escape($table);
273 273
     $result = $dbConnection->query($sql);
274 274
 
275 275
     if ($result && $result->num_rows > 0) {
@@ -315,17 +315,17 @@  discard block
 block discarded – undo
315 315
 
316 316
     $whereSQL = $dbConnection->_parseArrayPair($whereArray, 'AND');
317 317
     if ($whereSQL) {
318
-      $whereSQL = 'AND ' . $whereSQL;
318
+      $whereSQL = 'AND '.$whereSQL;
319 319
     }
320 320
 
321 321
     if ($databaseName) {
322
-      $databaseName = $dbConnection->quote_string(trim($databaseName)) . '.';
322
+      $databaseName = $dbConnection->quote_string(trim($databaseName)).'.';
323 323
     }
324 324
 
325 325
     // get the row
326
-    $query = 'SELECT * FROM ' . $databaseName . $dbConnection->quote_string($table) . '
326
+    $query = 'SELECT * FROM '.$databaseName.$dbConnection->quote_string($table).'
327 327
       WHERE 1 = 1
328
-      ' . $whereSQL . '
328
+      ' . $whereSQL.'
329 329
     ';
330 330
     $result = $dbConnection->query($query);
331 331
 
@@ -345,11 +345,11 @@  discard block
 block discarded – undo
345 345
 
346 346
           if (!in_array($fieldName, $ignoreArray, true)) {
347 347
             if (array_key_exists($fieldName, $updateArray)) {
348
-              $insert_keys .= ',' . $fieldName;
348
+              $insert_keys .= ','.$fieldName;
349 349
               $insert_values .= ',?';
350 350
               $bindings[] = $updateArray[$fieldName]; // INFO: do not escape non selected data
351 351
             } else {
352
-              $insert_keys .= ',' . $fieldName;
352
+              $insert_keys .= ','.$fieldName;
353 353
               $insert_values .= ',?';
354 354
               $bindings[] = $value; // INFO: do not escape non selected data
355 355
             }
@@ -360,10 +360,10 @@  discard block
 block discarded – undo
360 360
         $insert_values = ltrim($insert_values, ',');
361 361
 
362 362
         // insert the "copied" row
363
-        $new_query = 'INSERT INTO ' . $databaseName . $dbConnection->quote_string($table) . ' 
364
-          (' . $insert_keys . ')
363
+        $new_query = 'INSERT INTO '.$databaseName.$dbConnection->quote_string($table).' 
364
+          (' . $insert_keys.')
365 365
           VALUES 
366
-          (' . $insert_values . ')
366
+          (' . $insert_values.')
367 367
         ';
368 368
         return $dbConnection->query($new_query, $bindings);
369 369
       }
Please login to merge, or discard this patch.