Completed
Push — master ( db4a8c...45870c )
by Lars
16:59 queued 01:30
created
src/voku/db/Prepare.php 2 patches
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -170,7 +170,7 @@
 block discarded – undo
170 170
    * @param mixed  $v34
171 171
    * @param mixed  $v35
172 172
    *
173
-   * @return mixed
173
+   * @return boolean
174 174
    */
175 175
   public function bind_param_debug($types, &$v1 = null, &$v2 = null, &$v3 = null, &$v4 = null, &$v5 = null, &$v6 = null, &$v7 = null, &$v8 = null, &$v9 = null, &$v10 = null, &$v11 = null, &$v12 = null, &$v13 = null, &$v14 = null, &$v15 = null, &$v16 = null, &$v17 = null, &$v18 = null, &$v19 = null, &$v20 = null, &$v21 = null, &$v22 = null, &$v23 = null, &$v24 = null, &$v25 = null, &$v26 = null, &$v27 = null, &$v28 = null, &$v29 = null, &$v30 = null, &$v31 = null, &$v32 = null, &$v33 = null, &$v34 = null, &$v35 = null)
176 176
   {
Please login to merge, or discard this patch.
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -81,7 +81,7 @@  discard block
 block discarded – undo
81 81
 
82 82
     foreach ($this->_boundParams as $param) {
83 83
       $arguments[0] .= $param['type'];
84
-      $arguments[] =& $param['value'];
84
+      $arguments[] = & $param['value'];
85 85
     }
86 86
 
87 87
     return $arguments;
@@ -104,7 +104,7 @@  discard block
 block discarded – undo
104 104
     $value = $this->_db->escape($value);
105 105
 
106 106
     if ($type === 's') {
107
-      $valueForSqlWithBoundParameters = "'" . $value . "'";
107
+      $valueForSqlWithBoundParameters = "'".$value."'";
108 108
     } elseif ($type === 'i') {
109 109
       $valueForSqlWithBoundParameters = (int)$value;
110 110
     } elseif ($type === 'd') {
@@ -185,7 +185,7 @@  discard block
 block discarded – undo
185 185
       $trace = debug_backtrace();
186 186
     }
187 187
 
188
-    $args =& $trace[0]['args'];
188
+    $args = & $trace[0]['args'];
189 189
     $types = str_split($types);
190 190
 
191 191
     $args_count = count($args) - 1;
@@ -199,7 +199,7 @@  discard block
 block discarded – undo
199 199
 
200 200
     $arg = 1;
201 201
     foreach ($types as $typeInner) {
202
-      $val =& $args[$arg];
202
+      $val = & $args[$arg];
203 203
       $this->_boundParams[] = array(
204 204
           'type'  => $typeInner,
205 205
           'value' => &$val,
@@ -335,7 +335,7 @@  discard block
 block discarded – undo
335 335
     $bool = parent::prepare($query);
336 336
 
337 337
     if ($bool === false) {
338
-      $this->_debug->displayError('Can not prepare query: ' . $query . ' | ' . $this->error, false);
338
+      $this->_debug->displayError('Can not prepare query: '.$query.' | '.$this->error, false);
339 339
     }
340 340
 
341 341
     return $bool;
@@ -423,11 +423,11 @@  discard block
 block discarded – undo
423 423
 
424 424
       // exit if we have more then 3 "DB server has gone away"-errors
425 425
       if ($RECONNECT_COUNTER > 3) {
426
-        $this->_debug->mailToAdmin('DB-Fatal-Error', $errorMsg . ":\n<br />" . $sql, 5);
426
+        $this->_debug->mailToAdmin('DB-Fatal-Error', $errorMsg.":\n<br />".$sql, 5);
427 427
         throw new DBGoneAwayException($errorMsg);
428 428
       }
429 429
 
430
-      $this->_debug->mailToAdmin('DB-Error', $errorMsg . ":\n<br />" . $sql);
430
+      $this->_debug->mailToAdmin('DB-Error', $errorMsg.":\n<br />".$sql);
431 431
 
432 432
       // reconnect
433 433
       $RECONNECT_COUNTER++;
@@ -437,10 +437,10 @@  discard block
 block discarded – undo
437 437
       return $this->execute();
438 438
     }
439 439
 
440
-    $this->_debug->mailToAdmin('SQL-Error', $errorMsg . ":\n<br />" . $sql);
440
+    $this->_debug->mailToAdmin('SQL-Error', $errorMsg.":\n<br />".$sql);
441 441
 
442 442
     // this query returned an error, we must display it (only for dev) !!!
443
-    $this->_debug->displayError($errorMsg . ' | ' . $sql);
443
+    $this->_debug->displayError($errorMsg.' | '.$sql);
444 444
 
445 445
     return false;
446 446
   }
Please login to merge, or discard this patch.
src/voku/db/Debug.php 1 patch
Spacing   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -133,9 +133,9 @@  discard block
 block discarded – undo
133 133
     $this->logger(
134 134
         array(
135 135
             'error',
136
-            '<strong>' . date(
136
+            '<strong>'.date(
137 137
                 'd. m. Y G:i:s'
138
-            ) . ' (' . $fileInfo['file'] . ' line: ' . $fileInfo['line'] . ') (sql-error):</strong> ' . $error . '<br>',
138
+            ).' ('.$fileInfo['file'].' line: '.$fileInfo['line'].') (sql-error):</strong> '.$error.'<br>',
139 139
         )
140 140
     );
141 141
 
@@ -148,11 +148,11 @@  discard block
 block discarded – undo
148 148
         $box_bg = $this->css_mysql_box_bg;
149 149
 
150 150
         echo '
151
-        <div class="OBJ-mysql-box" style="border:' . $box_border . '; background:' . $box_bg . '; padding:10px; margin:10px;">
151
+        <div class="OBJ-mysql-box" style="border:' . $box_border.'; background:'.$box_bg.'; padding:10px; margin:10px;">
152 152
           <b style="font-size:14px;">MYSQL Error:</b>
153 153
           <code style="display:block;">
154
-            file / line: ' . $fileInfo['file'] . ' / ' . $fileInfo['line'] . '
155
-            ' . $error . '
154
+            file / line: ' . $fileInfo['file'].' / '.$fileInfo['line'].'
155
+            ' . $error.'
156 156
           </code>
157 157
         </div>
158 158
         ';
@@ -293,21 +293,21 @@  discard block
 block discarded – undo
293 293
     // get extra info
294 294
     $infoExtra = \mysqli_info($this->_db->getLink());
295 295
     if ($infoExtra) {
296
-      $infoExtra = ' | info => ' . $infoExtra;
296
+      $infoExtra = ' | info => '.$infoExtra;
297 297
     }
298 298
 
299 299
     //
300 300
     // logging
301 301
     //
302 302
 
303
-    $info = 'time => ' . round($duration, 5) . ' | results => ' . (int)$results . $infoExtra . ' | SQL => ' . UTF8::htmlentities($sql);
303
+    $info = 'time => '.round($duration, 5).' | results => '.(int)$results.$infoExtra.' | SQL => '.UTF8::htmlentities($sql);
304 304
 
305 305
     $fileInfo = $this->getFileAndLineFromSql();
306 306
 
307 307
     return $this->logger(
308 308
         array(
309 309
             $logLevel,
310
-            '<strong>' . date('d. m. Y G:i:s') . ' (' . $fileInfo['file'] . ' line: ' . $fileInfo['line'] . '):</strong> ' . $info . '<br>',
310
+            '<strong>'.date('d. m. Y G:i:s').' ('.$fileInfo['file'].' line: '.$fileInfo['line'].'):</strong> '.$info.'<br>',
311 311
             'sql',
312 312
         )
313 313
     );
@@ -373,21 +373,21 @@  discard block
 block discarded – undo
373 373
         $this->logger(
374 374
             array(
375 375
                 'debug',
376
-                $subject . ' | ' . $htmlBody,
376
+                $subject.' | '.$htmlBody,
377 377
             )
378 378
         );
379 379
       } elseif ($priority > 3) {
380 380
         $this->logger(
381 381
             array(
382 382
                 'error',
383
-                $subject . ' | ' . $htmlBody,
383
+                $subject.' | '.$htmlBody,
384 384
             )
385 385
         );
386 386
       } elseif ($priority < 3) {
387 387
         $this->logger(
388 388
             array(
389 389
                 'info',
390
-                $subject . ' | ' . $htmlBody,
390
+                $subject.' | '.$htmlBody,
391 391
             )
392 392
         );
393 393
       }
Please login to merge, or discard this patch.
src/voku/db/Helper.php 2 patches
Doc Comments   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -14,7 +14,7 @@  discard block
 block discarded – undo
14 14
   /**
15 15
    * Check if "mysqlnd"-driver is used.
16 16
    *
17
-   * @return bool
17
+   * @return boolean|null
18 18
    */
19 19
   public static function isMysqlndIsUsed()
20 20
   {
@@ -150,7 +150,7 @@  discard block
 block discarded – undo
150 150
    *
151 151
    * @param DB $dbConnection
152 152
    *
153
-   * @return string
153
+   * @return integer|null
154 154
    */
155 155
   public static function get_mysql_client_version(DB $dbConnection = null)
156 156
   {
@@ -173,7 +173,7 @@  discard block
 block discarded – undo
173 173
    *
174 174
    * @param DB $dbConnection
175 175
    *
176
-   * @return string
176
+   * @return integer|null
177 177
    */
178 178
   public static function get_mysql_server_version(DB $dbConnection = null)
179 179
   {
Please login to merge, or discard this patch.
Spacing   +19 added lines, -19 removed lines patch added patch discarded remove patch
@@ -29,7 +29,7 @@  discard block
 block discarded – undo
29 29
     $optimized = 0;
30 30
     if (!empty($tables)) {
31 31
       foreach ($tables as $table) {
32
-        $optimize = 'OPTIMIZE TABLE ' . $dbConnection->quote_string($table);
32
+        $optimize = 'OPTIMIZE TABLE '.$dbConnection->quote_string($table);
33 33
         $result = $dbConnection->query($optimize);
34 34
         if ($result) {
35 35
           $optimized++;
@@ -57,7 +57,7 @@  discard block
 block discarded – undo
57 57
     $optimized = 0;
58 58
     if (!empty($tables)) {
59 59
       foreach ($tables as $table) {
60
-        $optimize = 'REPAIR TABLE ' . $dbConnection->quote_string($table);
60
+        $optimize = 'REPAIR TABLE '.$dbConnection->quote_string($table);
61 61
         $result = $dbConnection->query($optimize);
62 62
         if ($result) {
63 63
           $optimized++;
@@ -176,23 +176,23 @@  discard block
 block discarded – undo
176 176
 
177 177
     $whereSQL = $dbConnection->_parseArrayPair($whereArray, 'AND');
178 178
     if ($whereSQL) {
179
-      $whereSQL = 'AND ' . $whereSQL;
179
+      $whereSQL = 'AND '.$whereSQL;
180 180
     }
181 181
 
182 182
     if ($databaseName) {
183
-      $databaseName = $dbConnection->quote_string(trim($databaseName)) . '.';
183
+      $databaseName = $dbConnection->quote_string(trim($databaseName)).'.';
184 184
     }
185 185
 
186 186
     // get the row
187
-    $query = 'SELECT ' . $dbConnection->quote_string($searchFieldName) . ', ' . $dbConnection->quote_string($idFieldName) . ' 
188
-      FROM ' . $databaseName . $dbConnection->quote_string($table) . '
187
+    $query = 'SELECT '.$dbConnection->quote_string($searchFieldName).', '.$dbConnection->quote_string($idFieldName).' 
188
+      FROM ' . $databaseName.$dbConnection->quote_string($table).'
189 189
       WHERE 1 = 1
190
-      ' . $whereSQL . '
190
+      ' . $whereSQL.'
191 191
     ';
192 192
 
193 193
     if ($useCache === true) {
194 194
       $cache = new Cache(null, null, false, $useCache);
195
-      $cacheKey = 'sql-phonetic-search-' . md5($query);
195
+      $cacheKey = 'sql-phonetic-search-'.md5($query);
196 196
 
197 197
       if (
198 198
           $cache->getCacheIsReady() === true
@@ -322,10 +322,10 @@  discard block
 block discarded – undo
322 322
     }
323 323
 
324 324
     if ($databaseName) {
325
-      $databaseName = $dbConnection->quote_string(trim($databaseName)) . '.';
325
+      $databaseName = $dbConnection->quote_string(trim($databaseName)).'.';
326 326
     }
327 327
 
328
-    $sql = 'SHOW COLUMNS FROM ' . $databaseName . $dbConnection->escape($table);
328
+    $sql = 'SHOW COLUMNS FROM '.$databaseName.$dbConnection->escape($table);
329 329
     $result = $dbConnection->query($sql);
330 330
 
331 331
     if ($result && $result->num_rows > 0) {
@@ -371,17 +371,17 @@  discard block
 block discarded – undo
371 371
 
372 372
     $whereSQL = $dbConnection->_parseArrayPair($whereArray, 'AND');
373 373
     if ($whereSQL) {
374
-      $whereSQL = 'AND ' . $whereSQL;
374
+      $whereSQL = 'AND '.$whereSQL;
375 375
     }
376 376
 
377 377
     if ($databaseName) {
378
-      $databaseName = $dbConnection->quote_string(trim($databaseName)) . '.';
378
+      $databaseName = $dbConnection->quote_string(trim($databaseName)).'.';
379 379
     }
380 380
 
381 381
     // get the row
382
-    $query = 'SELECT * FROM ' . $databaseName . $dbConnection->quote_string($table) . '
382
+    $query = 'SELECT * FROM '.$databaseName.$dbConnection->quote_string($table).'
383 383
       WHERE 1 = 1
384
-      ' . $whereSQL . '
384
+      ' . $whereSQL.'
385 385
     ';
386 386
     $result = $dbConnection->query($query);
387 387
 
@@ -401,11 +401,11 @@  discard block
 block discarded – undo
401 401
 
402 402
           if (!in_array($fieldName, $ignoreArray, true)) {
403 403
             if (array_key_exists($fieldName, $updateArray)) {
404
-              $insert_keys .= ',' . $fieldName;
404
+              $insert_keys .= ','.$fieldName;
405 405
               $insert_values .= ',?';
406 406
               $bindings[] = $updateArray[$fieldName]; // INFO: do not escape non selected data
407 407
             } else {
408
-              $insert_keys .= ',' . $fieldName;
408
+              $insert_keys .= ','.$fieldName;
409 409
               $insert_values .= ',?';
410 410
               $bindings[] = $value; // INFO: do not escape non selected data
411 411
             }
@@ -416,10 +416,10 @@  discard block
 block discarded – undo
416 416
         $insert_values = ltrim($insert_values, ',');
417 417
 
418 418
         // insert the "copied" row
419
-        $new_query = 'INSERT INTO ' . $databaseName . $dbConnection->quote_string($table) . ' 
420
-          (' . $insert_keys . ')
419
+        $new_query = 'INSERT INTO '.$databaseName.$dbConnection->quote_string($table).' 
420
+          (' . $insert_keys.')
421 421
           VALUES 
422
-          (' . $insert_values . ')
422
+          (' . $insert_values.')
423 423
         ';
424 424
         return $dbConnection->query($new_query, $bindings);
425 425
       }
Please login to merge, or discard this patch.
src/voku/db/Result.php 2 patches
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -622,7 +622,7 @@  discard block
 block discarded – undo
622 622
   {
623 623
     if ($as_array) {
624 624
       return array_map(
625
-          function ($object) {
625
+          function($object) {
626 626
             return (array)$object;
627 627
           },
628 628
           \mysqli_fetch_fields($this->_result)
@@ -734,7 +734,7 @@  discard block
 block discarded – undo
734 734
     }
735 735
 
736 736
     return array_map(
737
-        function ($values) use ($keys) {
737
+        function($values) use ($keys) {
738 738
           return array_combine($keys, $values);
739 739
         }, $rows
740 740
     );
Please login to merge, or discard this patch.
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -595,7 +595,7 @@
 block discarded – undo
595 595
    *                              parameter)<br>
596 596
    *                              <strong>object</strong>: use a object and fill the the data into
597 597
    *                              </p>
598
-   * @param null|array    $params optional
598
+   * @param null|string    $params optional
599 599
    *                              <p>
600 600
    *                              An array of parameters to pass to the constructor, used if $class is a
601 601
    *                              string.
Please login to merge, or discard this patch.
src/voku/db/ActiveRecord.php 2 patches
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -378,7 +378,7 @@  discard block
 block discarded – undo
378 378
     $value = $this->_filterParam($this->dirty);
379 379
     $this->insert = new ActiveRecordExpressions(
380 380
         array(
381
-            'operator' => 'INSERT INTO ' . $this->table,
381
+            'operator' => 'INSERT INTO '.$this->table,
382 382
             'target'   => new ActiveRecordExpressionsWrap(array('target' => array_keys($this->dirty))),
383 383
         )
384 384
     );
@@ -556,7 +556,7 @@  discard block
 block discarded – undo
556 556
         null === $o->$n
557 557
     ) {
558 558
 
559
-      $n = strtoupper($n) . ' ' . $o->table . '.*';
559
+      $n = strtoupper($n).' '.$o->table.'.*';
560 560
 
561 561
     } elseif (
562 562
         (
@@ -568,15 +568,15 @@  discard block
 block discarded – undo
568 568
         null === $o->$n
569 569
     ) {
570 570
 
571
-      $n = strtoupper($n) . ' ' . $o->table;
571
+      $n = strtoupper($n).' '.$o->table;
572 572
 
573 573
     } elseif ('delete' === $n) {
574 574
 
575
-      $n = strtoupper($n) . ' ';
575
+      $n = strtoupper($n).' ';
576 576
 
577 577
     } else {
578 578
 
579
-      $n = (null !== $o->$n) ? $o->$n . ' ' : '';
579
+      $n = (null !== $o->$n) ? $o->$n.' ' : '';
580 580
 
581 581
     }
582 582
   }
@@ -689,10 +689,10 @@  discard block
 block discarded – undo
689 689
   {
690 690
     if (is_array($value)) {
691 691
       foreach ($value as $key => $val) {
692
-        $this->params[$value[$key] = self::PREFIX . ++self::$count] = $val;
692
+        $this->params[$value[$key] = self::PREFIX.++self::$count] = $val;
693 693
       }
694 694
     } elseif (is_string($value)) {
695
-      $this->params[$ph = self::PREFIX . ++self::$count] = $value;
695
+      $this->params[$ph = self::PREFIX.++self::$count] = $value;
696 696
       $value = $ph;
697 697
     }
698 698
 
@@ -714,7 +714,7 @@  discard block
 block discarded – undo
714 714
     $value = $this->_filterParam($value);
715 715
     $exp = new ActiveRecordExpressions(
716 716
         array(
717
-            'source'   => ('where' == $name ? $this->table . '.' : '') . $field,
717
+            'source'   => ('where' == $name ? $this->table.'.' : '').$field,
718 718
             'operator' => $operator,
719 719
             'target'   => is_array($value)
720 720
                 ? new ActiveRecordExpressionsWrap(
@@ -748,7 +748,7 @@  discard block
 block discarded – undo
748 748
     $this->join = new ActiveRecordExpressions(
749 749
         array(
750 750
             'source'   => $this->join ?: '',
751
-            'operator' => $type . ' JOIN',
751
+            'operator' => $type.' JOIN',
752 752
             'target'   => new ActiveRecordExpressions(
753 753
                 array('source' => $table, 'operator' => 'ON', 'target' => $on)
754 754
             ),
Please login to merge, or discard this patch.
Doc Comments   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -816,7 +816,7 @@  discard block
 block discarded – undo
816 816
   /**
817 817
    * Helper function to build SQL with sql parts.
818 818
    *
819
-   * @param array $sqls <p>The SQL part will be build.</p>
819
+   * @param string[] $sqls <p>The SQL part will be build.</p>
820 820
    *
821 821
    * @return string
822 822
    */
@@ -1057,7 +1057,7 @@  discard block
 block discarded – undo
1057 1057
    * Magic function to SET values of the current object.
1058 1058
    *
1059 1059
    * @param mixed $var
1060
-   * @param mixed $val
1060
+   * @param ActiveRecord $val
1061 1061
    */
1062 1062
   public function __set($var, $val)
1063 1063
   {
Please login to merge, or discard this patch.
src/voku/db/DB.php 2 patches
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -249,7 +249,7 @@
 block discarded – undo
249 249
    * @param string      $username
250 250
    * @param string      $password
251 251
    * @param string      $database
252
-   * @param int|string  $port             <p>default is (int)3306</p>
252
+   * @param integer  $port             <p>default is (int)3306</p>
253 253
    * @param string      $charset          <p>default is 'utf8' or 'utf8mb4' (if supported)</p>
254 254
    * @param bool|string $exit_on_error    <p>Throw a 'Exception' when a query failed, otherwise it will return 'false'.
255 255
    *                                      Use a empty string "" or false to disable it.</p>
Please login to merge, or discard this patch.
Spacing   +32 added lines, -32 removed lines patch added patch discarded remove patch
@@ -437,9 +437,9 @@  discard block
 block discarded – undo
437 437
         }
438 438
 
439 439
         if ($_connector === 'NOT IN' || $_connector === 'IN') {
440
-          $_value = '(' . implode(',', $_value) . ')';
440
+          $_value = '('.implode(',', $_value).')';
441 441
         } elseif ($_connector === 'NOT BETWEEN' || $_connector === 'BETWEEN') {
442
-          $_value = '(' . implode(' AND ', $_value) . ')';
442
+          $_value = '('.implode(' AND ', $_value).')';
443 443
         }
444 444
 
445 445
       } else {
@@ -488,7 +488,7 @@  discard block
 block discarded – undo
488 488
           $valueInner = "''";
489 489
         }
490 490
 
491
-        $sql .= ' ' . $_glueHelperInner . ' ' . $quoteString . ' ' . $_connector . ' ' . $valueInner . " \n";
491
+        $sql .= ' '.$_glueHelperInner.' '.$quoteString.' '.$_connector.' '.$valueInner." \n";
492 492
         $tmpCounter++;
493 493
       }
494 494
 
@@ -682,7 +682,7 @@  discard block
 block discarded – undo
682 682
       );
683 683
 
684 684
     } catch (\Exception $e) {
685
-      $error = 'Error connecting to mysql server: ' . $e->getMessage();
685
+      $error = 'Error connecting to mysql server: '.$e->getMessage();
686 686
       $this->_debug->displayError($error, true);
687 687
       throw new DBConnectException($error, 100, $e);
688 688
     }
@@ -690,7 +690,7 @@  discard block
 block discarded – undo
690 690
 
691 691
     $errno = mysqli_connect_errno();
692 692
     if (!$this->connected || $errno) {
693
-      $error = 'Error connecting to mysql server: ' . \mysqli_connect_error() . ' (' . $errno . ')';
693
+      $error = 'Error connecting to mysql server: '.\mysqli_connect_error().' ('.$errno.')';
694 694
       $this->_debug->displayError($error, true);
695 695
       throw new DBConnectException($error, 101);
696 696
     }
@@ -731,10 +731,10 @@  discard block
 block discarded – undo
731 731
     }
732 732
 
733 733
     if ($databaseName) {
734
-      $databaseName = $this->quote_string(trim($databaseName)) . '.';
734
+      $databaseName = $this->quote_string(trim($databaseName)).'.';
735 735
     }
736 736
 
737
-    $sql = 'DELETE FROM ' . $databaseName . $this->quote_string($table) . " WHERE ($WHERE);";
737
+    $sql = 'DELETE FROM '.$databaseName.$this->quote_string($table)." WHERE ($WHERE);";
738 738
 
739 739
     return $this->query($sql);
740 740
   }
@@ -804,8 +804,8 @@  discard block
 block discarded – undo
804 804
         $nameTmp = substr($name, 1);
805 805
       }
806 806
 
807
-      $parseKeyInner = $nameTmp . '-' . $parseKey;
808
-      $sql = str_replace(':' . $nameTmp, $parseKeyInner, $sql);
807
+      $parseKeyInner = $nameTmp.'-'.$parseKey;
808
+      $sql = str_replace(':'.$nameTmp, $parseKeyInner, $sql);
809 809
     }
810 810
 
811 811
     foreach ($params as $name => $value) {
@@ -814,7 +814,7 @@  discard block
 block discarded – undo
814 814
         $nameTmp = substr($name, 1);
815 815
       }
816 816
 
817
-      $parseKeyInner = $nameTmp . '-' . $parseKey;
817
+      $parseKeyInner = $nameTmp.'-'.$parseKey;
818 818
       $sqlBefore = $sql;
819 819
       $secureParamValue = $this->secure($params[$name]);
820 820
 
@@ -1002,7 +1002,7 @@  discard block
 block discarded – undo
1002 1002
 
1003 1003
     if ($useCache === true) {
1004 1004
       $cache = new Cache(null, null, false, $useCache);
1005
-      $cacheKey = 'sql-' . md5($query);
1005
+      $cacheKey = 'sql-'.md5($query);
1006 1006
 
1007 1007
       if (
1008 1008
           $cache->getCacheIsReady() === true
@@ -1112,7 +1112,7 @@  discard block
 block discarded – undo
1112 1112
     static $firstInstance = null;
1113 1113
 
1114 1114
     if (
1115
-        $hostname . $username . $password . $database . $port . $charset == ''
1115
+        $hostname.$username.$password.$database.$port.$charset == ''
1116 1116
         &&
1117 1117
         null !== $firstInstance
1118 1118
     ) {
@@ -1122,7 +1122,7 @@  discard block
 block discarded – undo
1122 1122
     $extra_config_string = '';
1123 1123
     if (is_array($extra_config) === true) {
1124 1124
       foreach ($extra_config as $extra_config_key => $extra_config_value) {
1125
-        $extra_config_string .= $extra_config_key . (string)$extra_config_value;
1125
+        $extra_config_string .= $extra_config_key.(string)$extra_config_value;
1126 1126
       }
1127 1127
     } else {
1128 1128
       // only for backward compatibility
@@ -1130,7 +1130,7 @@  discard block
 block discarded – undo
1130 1130
     }
1131 1131
 
1132 1132
     $connection = md5(
1133
-        $hostname . $username . $password . $database . $port . $charset . (int)$exit_on_error . (int)$echo_on_error . $logger_class_name . $logger_level . $extra_config_string
1133
+        $hostname.$username.$password.$database.$port.$charset.(int)$exit_on_error.(int)$echo_on_error.$logger_class_name.$logger_level.$extra_config_string
1134 1134
     );
1135 1135
 
1136 1136
     if (!isset($instance[$connection])) {
@@ -1217,10 +1217,10 @@  discard block
 block discarded – undo
1217 1217
     $SET = $this->_parseArrayPair($data);
1218 1218
 
1219 1219
     if ($databaseName) {
1220
-      $databaseName = $this->quote_string(trim($databaseName)) . '.';
1220
+      $databaseName = $this->quote_string(trim($databaseName)).'.';
1221 1221
     }
1222 1222
 
1223
-    $sql = 'INSERT INTO ' . $databaseName . $this->quote_string($table) . " SET $SET;";
1223
+    $sql = 'INSERT INTO '.$databaseName.$this->quote_string($table)." SET $SET;";
1224 1224
 
1225 1225
     return $this->query($sql);
1226 1226
   }
@@ -1534,11 +1534,11 @@  discard block
 block discarded – undo
1534 1534
 
1535 1535
       // exit if we have more then 3 "DB server has gone away"-errors
1536 1536
       if ($RECONNECT_COUNTER > 3) {
1537
-        $this->_debug->mailToAdmin('DB-Fatal-Error', $errorMessage . '(' . $errorNumber . ') ' . ":\n<br />" . $sql, 5);
1537
+        $this->_debug->mailToAdmin('DB-Fatal-Error', $errorMessage.'('.$errorNumber.') '.":\n<br />".$sql, 5);
1538 1538
         throw new DBGoneAwayException($errorMessage);
1539 1539
       }
1540 1540
 
1541
-      $this->_debug->mailToAdmin('DB-Error', $errorMessage . '(' . $errorNumber . ') ' . ":\n<br />" . $sql);
1541
+      $this->_debug->mailToAdmin('DB-Error', $errorMessage.'('.$errorNumber.') '.":\n<br />".$sql);
1542 1542
 
1543 1543
       // reconnect
1544 1544
       $RECONNECT_COUNTER++;
@@ -1552,7 +1552,7 @@  discard block
 block discarded – undo
1552 1552
       return false;
1553 1553
     }
1554 1554
 
1555
-    $this->_debug->mailToAdmin('SQL-Error', $errorMessage . '(' . $errorNumber . ') ' . ":\n<br />" . $sql);
1555
+    $this->_debug->mailToAdmin('SQL-Error', $errorMessage.'('.$errorNumber.') '.":\n<br />".$sql);
1556 1556
 
1557 1557
     $force_exception_after_error = null; // auto
1558 1558
     if ($this->_in_transaction === true) {
@@ -1560,7 +1560,7 @@  discard block
 block discarded – undo
1560 1560
     }
1561 1561
     // this query returned an error, we must display it (only for dev) !!!
1562 1562
 
1563
-    $this->_debug->displayError($errorMessage . '(' . $errorNumber . ') ' . ' | ' . $sql, $force_exception_after_error);
1563
+    $this->_debug->displayError($errorMessage.'('.$errorNumber.') '.' | '.$sql, $force_exception_after_error);
1564 1564
 
1565 1565
     return false;
1566 1566
   }
@@ -1583,7 +1583,7 @@  discard block
 block discarded – undo
1583 1583
         )
1584 1584
     );
1585 1585
 
1586
-    return '`' . $str . '`';
1586
+    return '`'.$str.'`';
1587 1587
   }
1588 1588
 
1589 1589
   /**
@@ -1654,10 +1654,10 @@  discard block
 block discarded – undo
1654 1654
     $values = implode(',', $data);
1655 1655
 
1656 1656
     if ($databaseName) {
1657
-      $databaseName = $this->quote_string(trim($databaseName)) . '.';
1657
+      $databaseName = $this->quote_string(trim($databaseName)).'.';
1658 1658
     }
1659 1659
 
1660
-    $sql = 'REPLACE INTO ' . $databaseName . $this->quote_string($table) . " ($columns) VALUES ($values);";
1660
+    $sql = 'REPLACE INTO '.$databaseName.$this->quote_string($table)." ($columns) VALUES ($values);";
1661 1661
 
1662 1662
     return $this->query($sql);
1663 1663
   }
@@ -1755,7 +1755,7 @@  discard block
 block discarded – undo
1755 1755
     $var = $this->escape($var, false, false, null);
1756 1756
 
1757 1757
     if (is_string($var)) {
1758
-      $var = "'" . trim($var, "'") . "'";
1758
+      $var = "'".trim($var, "'")."'";
1759 1759
     }
1760 1760
 
1761 1761
     return $var;
@@ -1792,10 +1792,10 @@  discard block
 block discarded – undo
1792 1792
     }
1793 1793
 
1794 1794
     if ($databaseName) {
1795
-      $databaseName = $this->quote_string(trim($databaseName)) . '.';
1795
+      $databaseName = $this->quote_string(trim($databaseName)).'.';
1796 1796
     }
1797 1797
 
1798
-    $sql = 'SELECT * FROM ' . $databaseName . $this->quote_string($table) . " WHERE ($WHERE);";
1798
+    $sql = 'SELECT * FROM '.$databaseName.$this->quote_string($table)." WHERE ($WHERE);";
1799 1799
 
1800 1800
     return $this->query($sql);
1801 1801
   }
@@ -1838,10 +1838,10 @@  discard block
 block discarded – undo
1838 1838
     $return = mysqli_set_charset($this->link, $charset);
1839 1839
     /** @noinspection PhpUsageOfSilenceOperatorInspection */
1840 1840
     /** @noinspection UsageOfSilenceOperatorInspection */
1841
-    @\mysqli_query($this->link, 'SET CHARACTER SET ' . $charset);
1841
+    @\mysqli_query($this->link, 'SET CHARACTER SET '.$charset);
1842 1842
     /** @noinspection PhpUsageOfSilenceOperatorInspection */
1843 1843
     /** @noinspection UsageOfSilenceOperatorInspection */
1844
-    @\mysqli_query($this->link, "SET NAMES '" . $charset . "'");
1844
+    @\mysqli_query($this->link, "SET NAMES '".$charset."'");
1845 1845
 
1846 1846
     return $return;
1847 1847
   }
@@ -1975,7 +1975,7 @@  discard block
 block discarded – undo
1975 1975
       $result = call_user_func($callback, $this);
1976 1976
       if ($result === false) {
1977 1977
         /** @noinspection ThrowRawExceptionInspection */
1978
-        throw new \Exception('call_user_func [' . $callback . '] === false');
1978
+        throw new \Exception('call_user_func ['.$callback.'] === false');
1979 1979
       }
1980 1980
 
1981 1981
       return $this->commit();
@@ -2028,10 +2028,10 @@  discard block
 block discarded – undo
2028 2028
     }
2029 2029
 
2030 2030
     if ($databaseName) {
2031
-      $databaseName = $this->quote_string(trim($databaseName)) . '.';
2031
+      $databaseName = $this->quote_string(trim($databaseName)).'.';
2032 2032
     }
2033 2033
 
2034
-    $sql = 'UPDATE ' . $databaseName . $this->quote_string($table) . " SET $SET WHERE ($WHERE);";
2034
+    $sql = 'UPDATE '.$databaseName.$this->quote_string($table)." SET $SET WHERE ($WHERE);";
2035 2035
 
2036 2036
     return $this->query($sql);
2037 2037
   }
@@ -2045,7 +2045,7 @@  discard block
 block discarded – undo
2045 2045
    */
2046 2046
   public function table_exists($table)
2047 2047
   {
2048
-    $check = $this->query('SELECT 1 FROM ' . $this->quote_string($table));
2048
+    $check = $this->query('SELECT 1 FROM '.$this->quote_string($table));
2049 2049
     if (
2050 2050
         $check !== false
2051 2051
         &&
Please login to merge, or discard this patch.
src/voku/db/ActiveRecordExpressionsWrap.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -19,9 +19,9 @@
 block discarded – undo
19 19
     $delimiter = (string)($this->delimiter ?: ',');
20 20
 
21 21
     if ($this->start) {
22
-      return $this->start . implode($delimiter, $this->target->getArray()) . ($this->end ?: ')');
22
+      return $this->start.implode($delimiter, $this->target->getArray()).($this->end ?: ')');
23 23
     }
24 24
 
25
-    return '(' . implode($delimiter, $this->target->getArray()) . ($this->end ? $this->end : ')');
25
+    return '('.implode($delimiter, $this->target->getArray()).($this->end ? $this->end : ')');
26 26
   }
27 27
 }
Please login to merge, or discard this patch.
src/voku/db/ActiveRecordExpressions.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -21,6 +21,6 @@
 block discarded – undo
21 21
    */
22 22
   public function __toString()
23 23
   {
24
-    return $this->source . ' ' . $this->operator . ' ' . $this->target;
24
+    return $this->source.' '.$this->operator.' '.$this->target;
25 25
   }
26 26
 }
Please login to merge, or discard this patch.