Completed
Pull Request — master (#28)
by Lars
01:43
created
src/voku/db/Prepare.php 2 patches
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -173,7 +173,7 @@
 block discarded – undo
173 173
    * @param mixed  $v34
174 174
    * @param mixed  $v35
175 175
    *
176
-   * @return mixed
176
+   * @return boolean
177 177
    */
178 178
   public function bind_param_debug(string $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)
179 179
   {
Please login to merge, or discard this patch.
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -1,6 +1,6 @@  discard block
 block discarded – undo
1 1
 <?php
2 2
 
3
-declare(strict_types=1);
3
+declare(strict_types = 1);
4 4
 
5 5
 namespace voku\db;
6 6
 
@@ -82,7 +82,7 @@  discard block
 block discarded – undo
82 82
 
83 83
     foreach ($this->_boundParams as $param) {
84 84
       $arguments[0] .= $param['type'];
85
-      $arguments[] =& $param['value'];
85
+      $arguments[] = & $param['value'];
86 86
     }
87 87
 
88 88
     return $arguments;
@@ -105,7 +105,7 @@  discard block
 block discarded – undo
105 105
     $value = $this->_db->escape($value);
106 106
 
107 107
     if ($type === 's') {
108
-      $valueForSqlWithBoundParameters = "'" . $value . "'";
108
+      $valueForSqlWithBoundParameters = "'".$value."'";
109 109
     } elseif ($type === 'i') {
110 110
       $valueForSqlWithBoundParameters = (int)$value;
111 111
     } elseif ($type === 'd') {
@@ -182,7 +182,7 @@  discard block
 block discarded – undo
182 182
     // debug_backtrace returns arguments by reference, see comments at http://php.net/manual/de/function.func-get-args.php
183 183
     $trace = \debug_backtrace(DEBUG_BACKTRACE_PROVIDE_OBJECT, 1);
184 184
 
185
-    $args =& $trace[0]['args'];
185
+    $args = & $trace[0]['args'];
186 186
     $types = \str_split($types);
187 187
 
188 188
     $args_count = \count($args) - 1;
@@ -196,7 +196,7 @@  discard block
 block discarded – undo
196 196
 
197 197
     $arg = 1;
198 198
     foreach ($types as $typeInner) {
199
-      $val =& $args[$arg];
199
+      $val = & $args[$arg];
200 200
       $this->_boundParams[] = array(
201 201
           'type'  => $typeInner,
202 202
           'value' => &$val,
@@ -332,7 +332,7 @@  discard block
 block discarded – undo
332 332
     $bool = parent::prepare($query);
333 333
 
334 334
     if ($bool === false) {
335
-      $this->_debug->displayError('Can not prepare query: ' . $query . ' | ' . $this->error, false);
335
+      $this->_debug->displayError('Can not prepare query: '.$query.' | '.$this->error, false);
336 336
     }
337 337
 
338 338
     return $bool;
@@ -420,11 +420,11 @@  discard block
 block discarded – undo
420 420
 
421 421
       // exit if we have more then 3 "DB server has gone away"-errors
422 422
       if ($RECONNECT_COUNTER > 3) {
423
-        $this->_debug->mailToAdmin('DB-Fatal-Error', $errorMsg . ":\n<br />" . $sql, 5);
423
+        $this->_debug->mailToAdmin('DB-Fatal-Error', $errorMsg.":\n<br />".$sql, 5);
424 424
         throw new DBGoneAwayException($errorMsg);
425 425
       }
426 426
 
427
-      $this->_debug->mailToAdmin('DB-Error', $errorMsg . ":\n<br />" . $sql);
427
+      $this->_debug->mailToAdmin('DB-Error', $errorMsg.":\n<br />".$sql);
428 428
 
429 429
       // reconnect
430 430
       $RECONNECT_COUNTER++;
@@ -434,10 +434,10 @@  discard block
 block discarded – undo
434 434
       return $this->execute();
435 435
     }
436 436
 
437
-    $this->_debug->mailToAdmin('SQL-Error', $errorMsg . ":\n<br />" . $sql);
437
+    $this->_debug->mailToAdmin('SQL-Error', $errorMsg.":\n<br />".$sql);
438 438
 
439 439
     // this query returned an error, we must display it (only for dev) !!!
440
-    $this->_debug->displayError($errorMsg . ' | ' . $sql);
440
+    $this->_debug->displayError($errorMsg.' | '.$sql);
441 441
 
442 442
     return false;
443 443
   }
Please login to merge, or discard this patch.
src/voku/db/exceptions/QueryException.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1,6 +1,6 @@
 block discarded – undo
1 1
 <?php
2 2
 
3
-declare(strict_types=1);
3
+declare(strict_types = 1);
4 4
 
5 5
 namespace voku\db\exceptions;
6 6
 
Please login to merge, or discard this patch.
src/voku/db/ActiveRecordExpressions.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -1,6 +1,6 @@  discard block
 block discarded – undo
1 1
 <?php
2 2
 
3
-declare(strict_types=1);
3
+declare(strict_types = 1);
4 4
 
5 5
 namespace voku\db;
6 6
 
@@ -23,6 +23,6 @@  discard block
 block discarded – undo
23 23
    */
24 24
   public function __toString()
25 25
   {
26
-    return $this->source . ' ' . $this->operator . ' ' . $this->target;
26
+    return $this->source.' '.$this->operator.' '.$this->target;
27 27
   }
28 28
 }
Please login to merge, or discard this patch.
src/voku/db/ActiveRecordExpressionsWrap.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -1,6 +1,6 @@  discard block
 block discarded – undo
1 1
 <?php
2 2
 
3
-declare(strict_types=1);
3
+declare(strict_types = 1);
4 4
 
5 5
 namespace voku\db;
6 6
 
@@ -21,9 +21,9 @@  discard block
 block discarded – undo
21 21
     $delimiter = (string)($this->delimiter ?: ',');
22 22
 
23 23
     if ($this->start) {
24
-      return $this->start . implode($delimiter, $this->target->getArray()) . ($this->end ?: ')');
24
+      return $this->start.implode($delimiter, $this->target->getArray()).($this->end ?: ')');
25 25
     }
26 26
 
27
-    return '(' . implode($delimiter, $this->target->getArray()) . ($this->end ?: ')');
27
+    return '('.implode($delimiter, $this->target->getArray()).($this->end ?: ')');
28 28
   }
29 29
 }
Please login to merge, or discard this patch.
src/voku/db/exceptions/FetchingException.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1,6 +1,6 @@
 block discarded – undo
1 1
 <?php
2 2
 
3
-declare(strict_types=1);
3
+declare(strict_types = 1);
4 4
 
5 5
 namespace voku\db\exceptions;
6 6
 
Please login to merge, or discard this patch.
src/voku/db/exceptions/DBConnectException.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1,6 +1,6 @@
 block discarded – undo
1 1
 <?php
2 2
 
3
-declare(strict_types=1);
3
+declare(strict_types = 1);
4 4
 
5 5
 namespace voku\db\exceptions;
6 6
 
Please login to merge, or discard this patch.
src/voku/db/exceptions/DBGoneAwayException.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1,6 +1,6 @@
 block discarded – undo
1 1
 <?php
2 2
 
3
-declare(strict_types=1);
3
+declare(strict_types = 1);
4 4
 
5 5
 namespace voku\db\exceptions;
6 6
 
Please login to merge, or discard this patch.
src/voku/db/exceptions/ActiveRecordException.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1,6 +1,6 @@
 block discarded – undo
1 1
 <?php
2 2
 
3
-declare(strict_types=1);
3
+declare(strict_types = 1);
4 4
 
5 5
 namespace voku\db\exceptions;
6 6
 
Please login to merge, or discard this patch.
src/voku/db/Result.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -1,6 +1,6 @@  discard block
 block discarded – undo
1 1
 <?php
2 2
 
3
-declare(strict_types=1);
3
+declare(strict_types = 1);
4 4
 
5 5
 namespace voku\db;
6 6
 
@@ -679,7 +679,7 @@  discard block
 block discarded – undo
679 679
   {
680 680
     if ($as_array) {
681 681
       return \array_map(
682
-          function ($object) {
682
+          function($object) {
683 683
             return (array)$object;
684 684
           },
685 685
           \mysqli_fetch_fields($this->_result)
@@ -791,7 +791,7 @@  discard block
 block discarded – undo
791 791
     }
792 792
 
793 793
     return \array_map(
794
-        function ($values) use ($keys) {
794
+        function($values) use ($keys) {
795 795
           return \array_combine($keys, $values);
796 796
         }, $rows
797 797
     );
Please login to merge, or discard this patch.