@@ -822,7 +822,7 @@ |
||
| 822 | 822 | /** |
| 823 | 823 | * Helper function to build SQL with sql parts. |
| 824 | 824 | * |
| 825 | - * @param array $sqls <p>The SQL part will be build.</p> |
|
| 825 | + * @param string[] $sqls <p>The SQL part will be build.</p> |
|
| 826 | 826 | * |
| 827 | 827 | * @return string |
| 828 | 828 | */ |
@@ -1,6 +1,6 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | 2 | |
| 3 | -declare(strict_types=1); |
|
| 3 | +declare(strict_types = 1); |
|
| 4 | 4 | |
| 5 | 5 | namespace voku\db; |
| 6 | 6 | |
@@ -583,7 +583,7 @@ discard block |
||
| 583 | 583 | $value = $this->_filterParam($this->dirty); |
| 584 | 584 | $this->insert = new ActiveRecordExpressions( |
| 585 | 585 | array( |
| 586 | - 'operator' => 'INSERT INTO ' . $this->table, |
|
| 586 | + 'operator' => 'INSERT INTO '.$this->table, |
|
| 587 | 587 | 'target' => new ActiveRecordExpressionsWrap(array('target' => \array_keys($this->dirty))), |
| 588 | 588 | ) |
| 589 | 589 | ); |
@@ -786,7 +786,7 @@ discard block |
||
| 786 | 786 | * @param int $i <p>The index of $n in $sql array.</p> |
| 787 | 787 | * @param ActiveRecord $o <p>The reference to $this.</p> |
| 788 | 788 | */ |
| 789 | - private function _buildSqlCallback(string &$n, $i, ActiveRecord $o) |
|
| 789 | + private function _buildSqlCallback(string & $n, $i, ActiveRecord $o) |
|
| 790 | 790 | { |
| 791 | 791 | if ( |
| 792 | 792 | 'select' === $n |
@@ -794,7 +794,7 @@ discard block |
||
| 794 | 794 | null === $o->{$n} |
| 795 | 795 | ) { |
| 796 | 796 | |
| 797 | - $n = \strtoupper($n) . ' ' . $o->table . '.*'; |
|
| 797 | + $n = \strtoupper($n).' '.$o->table.'.*'; |
|
| 798 | 798 | |
| 799 | 799 | } elseif ( |
| 800 | 800 | ( |
@@ -806,15 +806,15 @@ discard block |
||
| 806 | 806 | null === $o->{$n} |
| 807 | 807 | ) { |
| 808 | 808 | |
| 809 | - $n = \strtoupper($n) . ' ' . $o->table; |
|
| 809 | + $n = \strtoupper($n).' '.$o->table; |
|
| 810 | 810 | |
| 811 | 811 | } elseif ('delete' === $n) { |
| 812 | 812 | |
| 813 | - $n = \strtoupper($n) . ' '; |
|
| 813 | + $n = \strtoupper($n).' '; |
|
| 814 | 814 | |
| 815 | 815 | } else { |
| 816 | 816 | |
| 817 | - $n = (null !== $o->{$n}) ? $o->{$n} . ' ' : ''; |
|
| 817 | + $n = (null !== $o->{$n}) ? $o->{$n}.' ' : ''; |
|
| 818 | 818 | |
| 819 | 819 | } |
| 820 | 820 | } |
@@ -927,10 +927,10 @@ discard block |
||
| 927 | 927 | { |
| 928 | 928 | if (\is_array($value)) { |
| 929 | 929 | foreach ($value as $key => $val) { |
| 930 | - $this->params[$value[$key] = self::PREFIX . ++self::$count] = $val; |
|
| 930 | + $this->params[$value[$key] = self::PREFIX.++self::$count] = $val; |
|
| 931 | 931 | } |
| 932 | 932 | } elseif (\is_string($value)) { |
| 933 | - $this->params[$ph = self::PREFIX . ++self::$count] = $value; |
|
| 933 | + $this->params[$ph = self::PREFIX.++self::$count] = $value; |
|
| 934 | 934 | $value = $ph; |
| 935 | 935 | } |
| 936 | 936 | |
@@ -951,7 +951,7 @@ discard block |
||
| 951 | 951 | $value = $this->_filterParam($value); |
| 952 | 952 | $exp = new ActiveRecordExpressions( |
| 953 | 953 | array( |
| 954 | - 'source' => ('where' == $name ? $this->table . '.' : '') . $field, |
|
| 954 | + 'source' => ('where' == $name ? $this->table.'.' : '').$field, |
|
| 955 | 955 | 'operator' => $operator, |
| 956 | 956 | 'target' => \is_array($value) |
| 957 | 957 | ? new ActiveRecordExpressionsWrap( |
@@ -984,7 +984,7 @@ discard block |
||
| 984 | 984 | $this->join = new ActiveRecordExpressions( |
| 985 | 985 | array( |
| 986 | 986 | 'source' => $this->join ?: '', |
| 987 | - 'operator' => $type . ' JOIN', |
|
| 987 | + 'operator' => $type.' JOIN', |
|
| 988 | 988 | 'target' => new ActiveRecordExpressions( |
| 989 | 989 | array('source' => $table, 'operator' => 'ON', 'target' => $on) |
| 990 | 990 | ), |
@@ -173,7 +173,7 @@ |
||
| 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 | { |
@@ -1,6 +1,6 @@ discard block |
||
| 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 |
||
| 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 |
||
| 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 |
||
| 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 |
||
| 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 |
||
| 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 |
||
| 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 |
||
| 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 | } |
@@ -1,6 +1,6 @@ |
||
| 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 | |
@@ -1,6 +1,6 @@ discard block |
||
| 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 |
||
| 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 | } |
@@ -1,6 +1,6 @@ discard block |
||
| 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 |
||
| 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 | } |
@@ -1,6 +1,6 @@ |
||
| 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 | |
@@ -1,6 +1,6 @@ |
||
| 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 | |
@@ -1,6 +1,6 @@ |
||
| 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 | |
@@ -1,6 +1,6 @@ |
||
| 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 | |