@@ -495,7 +495,7 @@ |
||
495 | 495 | public function applyQueries(string $query, array $tables, $escape = null) |
496 | 496 | { |
497 | 497 | if (!$escape) { |
498 | - $escape = function ($table) { |
|
498 | + $escape = function($table) { |
|
499 | 499 | return $this->table($table); |
500 | 500 | }; |
501 | 501 | } |
@@ -236,11 +236,9 @@ discard block |
||
236 | 236 | $bUseSqlLike = $this->driver->jush() === 'sql' && is_numeric($value) && preg_match('~\.~', $value); |
237 | 237 | return $column . ($bUseSqlLike ? |
238 | 238 | // LIKE because of floats but slow with ints |
239 | - " LIKE " . $this->driver->quote($value) : |
|
240 | - ($this->driver->jush() === 'mssql' ? |
|
239 | + " LIKE " . $this->driver->quote($value) : ($this->driver->jush() === 'mssql' ? |
|
241 | 240 | // LIKE because of text |
242 | - " LIKE " . $this->driver->quote(preg_replace('~[_%[]~', '[\0]', $value)) : |
|
243 | - //! enum and set |
|
241 | + " LIKE " . $this->driver->quote(preg_replace('~[_%[]~', '[\0]', $value)) : //! enum and set |
|
244 | 242 | " = " . $this->driver->unconvertField($field, $this->driver->quote($value)))); |
245 | 243 | } |
246 | 244 | |
@@ -255,8 +253,7 @@ discard block |
||
255 | 253 | { |
256 | 254 | $bCollate = $this->driver->jush() === 'sql' && |
257 | 255 | preg_match('~char|text~', $field->type) && preg_match("~[^ -@]~", $value); |
258 | - return !$bCollate ? '' : |
|
259 | - // not just [a-z] to catch non-ASCII characters |
|
256 | + return !$bCollate ? '' : // not just [a-z] to catch non-ASCII characters |
|
260 | 257 | "$column = " . $this->driver->quote($value) . " COLLATE " . $this->driver->charset() . "_bin"; |
261 | 258 | } |
262 | 259 | |
@@ -272,7 +269,7 @@ discard block |
||
272 | 269 | { |
273 | 270 | $clauses = []; |
274 | 271 | $wheres = $where["where"] ?? []; |
275 | - foreach ((array) $wheres as $key => $value) { |
|
272 | + foreach ((array)$wheres as $key => $value) { |
|
276 | 273 | $key = $this->util->bracketEscape($key, 1); // 1 - back |
277 | 274 | $column = $this->util->escapeKey($key); |
278 | 275 | $clauses[] = $this->getWhereColumnClause($fields[$key], $column, $value); |
@@ -281,7 +278,7 @@ discard block |
||
281 | 278 | } |
282 | 279 | } |
283 | 280 | $nulls = $where["null"] ?? []; |
284 | - foreach ((array) $nulls as $key) { |
|
281 | + foreach ((array)$nulls as $key) { |
|
285 | 282 | $clauses[] = $this->util->escapeKey($key) . " IS NULL"; |
286 | 283 | } |
287 | 284 | return implode(" AND ", $clauses); |