Completed
Push — master ( 4a2d34...3989bc )
by Lars
01:37
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/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
@@ -438,9 +438,9 @@  discard block
 block discarded – undo
438 438
         }
439 439
 
440 440
         if ($_connector === 'NOT IN' || $_connector === 'IN') {
441
-          $_value = '(' . implode(',', $_value) . ')';
441
+          $_value = '('.implode(',', $_value).')';
442 442
         } elseif ($_connector === 'NOT BETWEEN' || $_connector === 'BETWEEN') {
443
-          $_value = '(' . implode(' AND ', $_value) . ')';
443
+          $_value = '('.implode(' AND ', $_value).')';
444 444
         }
445 445
 
446 446
       } else {
@@ -485,7 +485,7 @@  discard block
 block discarded – undo
485 485
           $_glueHelperInner = 'AND ('; // inner-loop "OR"-query glue
486 486
         }
487 487
 
488
-        $sql .= ' ' . $_glueHelperInner . ' ' . $quoteString . ' ' . $_connector . ' ' . $valueInner . " \n";
488
+        $sql .= ' '.$_glueHelperInner.' '.$quoteString.' '.$_connector.' '.$valueInner." \n";
489 489
         $tmpCounter++;
490 490
       }
491 491
 
@@ -679,7 +679,7 @@  discard block
 block discarded – undo
679 679
       );
680 680
 
681 681
     } catch (\Exception $e) {
682
-      $error = 'Error connecting to mysql server: ' . $e->getMessage();
682
+      $error = 'Error connecting to mysql server: '.$e->getMessage();
683 683
       $this->_debug->displayError($error, true);
684 684
       throw new DBConnectException($error, 100, $e);
685 685
     }
@@ -687,7 +687,7 @@  discard block
 block discarded – undo
687 687
 
688 688
     $errno = mysqli_connect_errno();
689 689
     if (!$this->connected || $errno) {
690
-      $error = 'Error connecting to mysql server: ' . \mysqli_connect_error() . ' (' . $errno . ')';
690
+      $error = 'Error connecting to mysql server: '.\mysqli_connect_error().' ('.$errno.')';
691 691
       $this->_debug->displayError($error, true);
692 692
       throw new DBConnectException($error, 101);
693 693
     }
@@ -728,10 +728,10 @@  discard block
 block discarded – undo
728 728
     }
729 729
 
730 730
     if ($databaseName) {
731
-      $databaseName = $this->quote_string(trim($databaseName)) . '.';
731
+      $databaseName = $this->quote_string(trim($databaseName)).'.';
732 732
     }
733 733
 
734
-    $sql = 'DELETE FROM ' . $databaseName . $this->quote_string($table) . " WHERE ($WHERE);";
734
+    $sql = 'DELETE FROM '.$databaseName.$this->quote_string($table)." WHERE ($WHERE);";
735 735
 
736 736
     return $this->query($sql);
737 737
   }
@@ -801,8 +801,8 @@  discard block
 block discarded – undo
801 801
         $nameTmp = substr($name, 1);
802 802
       }
803 803
 
804
-      $parseKeyInner = $nameTmp . '-' . $parseKey;
805
-      $sql = str_replace(':' . $nameTmp, $parseKeyInner, $sql);
804
+      $parseKeyInner = $nameTmp.'-'.$parseKey;
805
+      $sql = str_replace(':'.$nameTmp, $parseKeyInner, $sql);
806 806
     }
807 807
 
808 808
     foreach ($params as $name => $value) {
@@ -811,7 +811,7 @@  discard block
 block discarded – undo
811 811
         $nameTmp = substr($name, 1);
812 812
       }
813 813
 
814
-      $parseKeyInner = $nameTmp . '-' . $parseKey;
814
+      $parseKeyInner = $nameTmp.'-'.$parseKey;
815 815
       $sqlBefore = $sql;
816 816
 
817 817
       while (strpos($sql, $parseKeyInner) !== false) {
@@ -988,7 +988,7 @@  discard block
 block discarded – undo
988 988
 
989 989
     if ($useCache === true) {
990 990
       $cache = new Cache(null, null, false, $useCache);
991
-      $cacheKey = 'sql-' . md5($query);
991
+      $cacheKey = 'sql-'.md5($query);
992 992
 
993 993
       if (
994 994
           $cache->getCacheIsReady() === true
@@ -1098,7 +1098,7 @@  discard block
 block discarded – undo
1098 1098
     static $firstInstance = null;
1099 1099
 
1100 1100
     if (
1101
-        $hostname . $username . $password . $database . $port . $charset == ''
1101
+        $hostname.$username.$password.$database.$port.$charset == ''
1102 1102
         &&
1103 1103
         null !== $firstInstance
1104 1104
     ) {
@@ -1108,7 +1108,7 @@  discard block
 block discarded – undo
1108 1108
     $extra_config_string = '';
1109 1109
     if (is_array($extra_config) === true) {
1110 1110
       foreach ($extra_config as $extra_config_key => $extra_config_value) {
1111
-        $extra_config_string .= $extra_config_key . (string)$extra_config_value;
1111
+        $extra_config_string .= $extra_config_key.(string)$extra_config_value;
1112 1112
       }
1113 1113
     } else {
1114 1114
       // only for backward compatibility
@@ -1116,7 +1116,7 @@  discard block
 block discarded – undo
1116 1116
     }
1117 1117
 
1118 1118
     $connection = md5(
1119
-        $hostname . $username . $password . $database . $port . $charset . (int)$exit_on_error . (int)$echo_on_error . $logger_class_name . $logger_level . $extra_config_string
1119
+        $hostname.$username.$password.$database.$port.$charset.(int)$exit_on_error.(int)$echo_on_error.$logger_class_name.$logger_level.$extra_config_string
1120 1120
     );
1121 1121
 
1122 1122
     if (!isset($instance[$connection])) {
@@ -1203,10 +1203,10 @@  discard block
 block discarded – undo
1203 1203
     $SET = $this->_parseArrayPair($data);
1204 1204
 
1205 1205
     if ($databaseName) {
1206
-      $databaseName = $this->quote_string(trim($databaseName)) . '.';
1206
+      $databaseName = $this->quote_string(trim($databaseName)).'.';
1207 1207
     }
1208 1208
 
1209
-    $sql = 'INSERT INTO ' . $databaseName . $this->quote_string($table) . " SET $SET;";
1209
+    $sql = 'INSERT INTO '.$databaseName.$this->quote_string($table)." SET $SET;";
1210 1210
 
1211 1211
     return $this->query($sql);
1212 1212
   }
@@ -1520,11 +1520,11 @@  discard block
 block discarded – undo
1520 1520
 
1521 1521
       // exit if we have more then 3 "DB server has gone away"-errors
1522 1522
       if ($RECONNECT_COUNTER > 3) {
1523
-        $this->_debug->mailToAdmin('DB-Fatal-Error', $errorMessage . '(' . $errorNumber . ') ' . ":\n<br />" . $sql, 5);
1523
+        $this->_debug->mailToAdmin('DB-Fatal-Error', $errorMessage.'('.$errorNumber.') '.":\n<br />".$sql, 5);
1524 1524
         throw new DBGoneAwayException($errorMessage);
1525 1525
       }
1526 1526
 
1527
-      $this->_debug->mailToAdmin('DB-Error', $errorMessage . '(' . $errorNumber . ') ' . ":\n<br />" . $sql);
1527
+      $this->_debug->mailToAdmin('DB-Error', $errorMessage.'('.$errorNumber.') '.":\n<br />".$sql);
1528 1528
 
1529 1529
       // reconnect
1530 1530
       $RECONNECT_COUNTER++;
@@ -1538,7 +1538,7 @@  discard block
 block discarded – undo
1538 1538
       return false;
1539 1539
     }
1540 1540
 
1541
-    $this->_debug->mailToAdmin('SQL-Error', $errorMessage . '(' . $errorNumber . ') ' . ":\n<br />" . $sql);
1541
+    $this->_debug->mailToAdmin('SQL-Error', $errorMessage.'('.$errorNumber.') '.":\n<br />".$sql);
1542 1542
 
1543 1543
     $force_exception_after_error = null; // auto
1544 1544
     if ($this->_in_transaction === true) {
@@ -1546,7 +1546,7 @@  discard block
 block discarded – undo
1546 1546
     }
1547 1547
     // this query returned an error, we must display it (only for dev) !!!
1548 1548
 
1549
-    $this->_debug->displayError($errorMessage . '(' . $errorNumber . ') ' . ' | ' . $sql, $force_exception_after_error);
1549
+    $this->_debug->displayError($errorMessage.'('.$errorNumber.') '.' | '.$sql, $force_exception_after_error);
1550 1550
 
1551 1551
     return false;
1552 1552
   }
@@ -1569,7 +1569,7 @@  discard block
 block discarded – undo
1569 1569
         )
1570 1570
     );
1571 1571
 
1572
-    return '`' . $str . '`';
1572
+    return '`'.$str.'`';
1573 1573
   }
1574 1574
 
1575 1575
   /**
@@ -1640,10 +1640,10 @@  discard block
 block discarded – undo
1640 1640
     $values = implode(',', $data);
1641 1641
 
1642 1642
     if ($databaseName) {
1643
-      $databaseName = $this->quote_string(trim($databaseName)) . '.';
1643
+      $databaseName = $this->quote_string(trim($databaseName)).'.';
1644 1644
     }
1645 1645
 
1646
-    $sql = 'REPLACE INTO ' . $databaseName . $this->quote_string($table) . " ($columns) VALUES ($values);";
1646
+    $sql = 'REPLACE INTO '.$databaseName.$this->quote_string($table)." ($columns) VALUES ($values);";
1647 1647
 
1648 1648
     return $this->query($sql);
1649 1649
   }
@@ -1731,7 +1731,7 @@  discard block
 block discarded – undo
1731 1731
     $var = $this->escape($var, false, false, null);
1732 1732
 
1733 1733
     if (is_string($var)) {
1734
-      $var = "'" . trim($var, "'") . "'";
1734
+      $var = "'".trim($var, "'")."'";
1735 1735
     }
1736 1736
 
1737 1737
     return $var;
@@ -1768,10 +1768,10 @@  discard block
 block discarded – undo
1768 1768
     }
1769 1769
 
1770 1770
     if ($databaseName) {
1771
-      $databaseName = $this->quote_string(trim($databaseName)) . '.';
1771
+      $databaseName = $this->quote_string(trim($databaseName)).'.';
1772 1772
     }
1773 1773
 
1774
-    $sql = 'SELECT * FROM ' . $databaseName . $this->quote_string($table) . " WHERE ($WHERE);";
1774
+    $sql = 'SELECT * FROM '.$databaseName.$this->quote_string($table)." WHERE ($WHERE);";
1775 1775
 
1776 1776
     return $this->query($sql);
1777 1777
   }
@@ -1814,10 +1814,10 @@  discard block
 block discarded – undo
1814 1814
     $return = mysqli_set_charset($this->link, $charset);
1815 1815
     /** @noinspection PhpUsageOfSilenceOperatorInspection */
1816 1816
     /** @noinspection UsageOfSilenceOperatorInspection */
1817
-    @\mysqli_query($this->link, 'SET CHARACTER SET ' . $charset);
1817
+    @\mysqli_query($this->link, 'SET CHARACTER SET '.$charset);
1818 1818
     /** @noinspection PhpUsageOfSilenceOperatorInspection */
1819 1819
     /** @noinspection UsageOfSilenceOperatorInspection */
1820
-    @\mysqli_query($this->link, "SET NAMES '" . $charset . "'");
1820
+    @\mysqli_query($this->link, "SET NAMES '".$charset."'");
1821 1821
 
1822 1822
     return $return;
1823 1823
   }
@@ -1945,7 +1945,7 @@  discard block
 block discarded – undo
1945 1945
       $result = call_user_func($callback, $this);
1946 1946
       if ($result === false) {
1947 1947
         /** @noinspection ThrowRawExceptionInspection */
1948
-        throw new \Exception('call_user_func [' . $callback . '] === false');
1948
+        throw new \Exception('call_user_func ['.$callback.'] === false');
1949 1949
       }
1950 1950
 
1951 1951
       return $this->commit();
@@ -1998,10 +1998,10 @@  discard block
 block discarded – undo
1998 1998
     }
1999 1999
 
2000 2000
     if ($databaseName) {
2001
-      $databaseName = $this->quote_string(trim($databaseName)) . '.';
2001
+      $databaseName = $this->quote_string(trim($databaseName)).'.';
2002 2002
     }
2003 2003
 
2004
-    $sql = 'UPDATE ' . $databaseName . $this->quote_string($table) . " SET $SET WHERE ($WHERE);";
2004
+    $sql = 'UPDATE '.$databaseName.$this->quote_string($table)." SET $SET WHERE ($WHERE);";
2005 2005
 
2006 2006
     return $this->query($sql);
2007 2007
   }
@@ -2015,7 +2015,7 @@  discard block
 block discarded – undo
2015 2015
    */
2016 2016
   public function table_exists($table)
2017 2017
   {
2018
-    $check = $this->query('SELECT 1 FROM ' . $this->quote_string($table));
2018
+    $check = $this->query('SELECT 1 FROM '.$this->quote_string($table));
2019 2019
     if (
2020 2020
         $check !== false
2021 2021
         &&
Please login to merge, or discard this patch.
src/voku/db/ActiveRecord.php 2 patches
Doc Comments   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -503,7 +503,7 @@  discard block
 block discarded – undo
503 503
   /**
504 504
    * Helper function to build SQL with sql parts.
505 505
    *
506
-   * @param array $sqls The SQL part will be build.
506
+   * @param string[] $sqls The SQL part will be build.
507 507
    *
508 508
    * @return string
509 509
    */
@@ -706,7 +706,7 @@  discard block
 block discarded – undo
706 706
    * Magic function to SET values of the current object.
707 707
    *
708 708
    * @param mixed $var
709
-   * @param mixed $val
709
+   * @param ActiveRecord $val
710 710
    */
711 711
   public function __set($var, $val)
712 712
   {
Please login to merge, or discard this patch.
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.
src/voku/db/ActiveRecordExpressionsWrap.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -12,9 +12,9 @@
 block discarded – undo
12 12
     $delimiter = $this->delimiter ?: ',';
13 13
 
14 14
     if ($this->start) {
15
-      return $this->start . implode($delimiter, $this->target->getArray()) . ($this->end ?: ')');
15
+      return $this->start.implode($delimiter, $this->target->getArray()).($this->end ?: ')');
16 16
     }
17 17
 
18
-    return '(' . implode($delimiter, $this->target->getArray()) . ($this->end ? $this->end : ')');
18
+    return '('.implode($delimiter, $this->target->getArray()).($this->end ? $this->end : ')');
19 19
   }
20 20
 }
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
@@ -18,6 +18,6 @@
 block discarded – undo
18 18
 {
19 19
   public function __toString()
20 20
   {
21
-    return $this->source . ' ' . $this->operator . ' ' . $this->target;
21
+    return $this->source.' '.$this->operator.' '.$this->target;
22 22
   }
23 23
 }
Please login to merge, or discard this patch.