@@ -239,8 +239,7 @@ discard block |
||
239 | 239 | $row[$key] = '"' . \str_replace('"', '""', $val) . '"'; |
240 | 240 | } |
241 | 241 | } |
242 | - $separator = $this->options['format'] == 'csv' ? ',' : |
|
243 | - ($this->options['format'] == 'tsv' ? "\t" : ';'); |
|
242 | + $separator = $this->options['format'] == 'csv' ? ',' : ($this->options['format'] == 'tsv' ? "\t" : ';'); |
|
244 | 243 | $this->queries[] = \implode($separator, $row); |
245 | 244 | } |
246 | 245 | |
@@ -354,7 +353,7 @@ discard block |
||
354 | 353 | } else { |
355 | 354 | if (!$insert) { |
356 | 355 | $insert = 'INSERT INTO ' . $this->driver->table($table) . ' (' . |
357 | - \implode(', ', \array_map(function ($key) { |
|
356 | + \implode(', ', \array_map(function($key) { |
|
358 | 357 | return $this->driver->escapeId($key); |
359 | 358 | }, $keys)) . ') VALUES'; |
360 | 359 | } |
@@ -526,8 +526,7 @@ |
||
526 | 526 | } |
527 | 527 | |
528 | 528 | $this->dumpTablesAndViews($database); |
529 | - } |
|
530 | - catch (\Exception $e) { |
|
529 | + } catch (\Exception $e) { |
|
531 | 530 | return $e->getMessage(); |
532 | 531 | } |
533 | 532 | } |
@@ -101,8 +101,7 @@ discard block |
||
101 | 101 | $maxlength = (!\preg_match('~int~', $field->type) && |
102 | 102 | \preg_match('~^(\d+)(,(\d+))?$~', $field->length, $match) ? |
103 | 103 | ((\preg_match("~binary~", $field->type) ? 2 : 1) * $match[1] + (($match[3] ?? null) ? 1 : 0) + |
104 | - (($match[2] ?? false) && !$unsigned ? 1 : 0)) : |
|
105 | - ($this->driver->typeExists($field->type) ? $this->driver->type($field->type) + ($unsigned ? 0 : 1) : 0)); |
|
104 | + (($match[2] ?? false) && !$unsigned ? 1 : 0)) : ($this->driver->typeExists($field->type) ? $this->driver->type($field->type) + ($unsigned ? 0 : 1) : 0)); |
|
106 | 105 | if ($this->driver->jush() == 'sql' && $this->driver->minVersion(5.6) && \preg_match('~time~', $field->type)) { |
107 | 106 | $maxlength += 7; // microtime |
108 | 107 | } |
@@ -243,8 +242,7 @@ discard block |
||
243 | 242 | $value = ( |
244 | 243 | $row !== null ? ( |
245 | 244 | $row[$name] != "" && $this->driver->jush() == "sql" && \preg_match("~enum|set~", $field->type) ? |
246 | - (\is_array($row[$name]) ? \array_sum($row[$name]) : +$row[$name]) : |
|
247 | - (\is_bool($row[$name]) ? +$row[$name] : $row[$name]) |
|
245 | + (\is_array($row[$name]) ? \array_sum($row[$name]) : +$row[$name]) : (\is_bool($row[$name]) ? +$row[$name] : $row[$name]) |
|
248 | 246 | ) : ( |
249 | 247 | !$update && $field->autoIncrement ? "" : (isset($queryOptions["select"]) ? false : $default) |
250 | 248 | ) |
@@ -254,7 +252,7 @@ discard block |
||
254 | 252 | } |
255 | 253 | $function = ( |
256 | 254 | $queryOptions["save"] |
257 | - ? (string)$queryOptions["function"][$name] |
|
255 | + ? (string) $queryOptions["function"][$name] |
|
258 | 256 | : ( |
259 | 257 | $update && \preg_match('~^CURRENT_TIMESTAMP~i', $field->onUpdate) |
260 | 258 | ? "now" |
@@ -23,7 +23,7 @@ discard block |
||
23 | 23 | { |
24 | 24 | return [ |
25 | 25 | 'select' => $select, |
26 | - 'values' => (array)$options["columns"], |
|
26 | + 'values' => (array) $options["columns"], |
|
27 | 27 | 'columns' => $columns, |
28 | 28 | 'functions' => $this->driver->functions(), |
29 | 29 | 'grouping' => $this->driver->grouping(), |
@@ -47,7 +47,7 @@ discard block |
||
47 | 47 | } |
48 | 48 | return [ |
49 | 49 | // 'where' => $where, |
50 | - 'values' => (array)$options["where"], |
|
50 | + 'values' => (array) $options["where"], |
|
51 | 51 | 'columns' => $columns, |
52 | 52 | 'indexes' => $indexes, |
53 | 53 | 'operators' => $this->driver->operators(), |
@@ -66,8 +66,8 @@ discard block |
||
66 | 66 | private function getSortingOptions(array $columns, array $options) |
67 | 67 | { |
68 | 68 | $values = []; |
69 | - $descs = (array)$options["desc"]; |
|
70 | - foreach ((array)$options["order"] as $key => $value) { |
|
69 | + $descs = (array) $options["desc"]; |
|
70 | + foreach ((array) $options["order"] as $key => $value) { |
|
71 | 71 | $values[] = [ |
72 | 72 | 'col' => $value, |
73 | 73 | 'desc' => $descs[$key] ?? 0, |