@@ -114,7 +114,7 @@ |
||
114 | 114 | * |
115 | 115 | * @return array |
116 | 116 | */ |
117 | - public function userTypes() ; |
|
117 | + public function userTypes(); |
|
118 | 118 | |
119 | 119 | /** |
120 | 120 | * Get existing schemas |
@@ -92,7 +92,7 @@ discard block |
||
92 | 92 | */ |
93 | 93 | private function fkFields(ForeignKeyEntity $foreignKey) |
94 | 94 | { |
95 | - $escape = function ($idf) { return $this->escapeId($idf); }; |
|
95 | + $escape = function($idf) { return $this->escapeId($idf); }; |
|
96 | 96 | return [ |
97 | 97 | implode(', ', array_map($escape, $foreignKey->source)), |
98 | 98 | implode(', ', array_map($escape, $foreignKey->target)), |
@@ -186,8 +186,7 @@ discard block |
||
186 | 186 | $query .= ' WHERE ' . implode(' AND ', $where); |
187 | 187 | } |
188 | 188 | return ($isGroup && ($this->driver->jush() == 'sql' || count($groups) == 1) ? |
189 | - 'SELECT COUNT(DISTINCT ' . implode(', ', $groups) . ")$query" : |
|
190 | - 'SELECT COUNT(*)' . ($isGroup ? " FROM (SELECT 1$query GROUP BY " . |
|
189 | + 'SELECT COUNT(DISTINCT ' . implode(', ', $groups) . ")$query" : 'SELECT COUNT(*)' . ($isGroup ? " FROM (SELECT 1$query GROUP BY " . |
|
191 | 190 | implode(', ', $groups) . ') x' : $query) |
192 | 191 | ); |
193 | 192 | } |
@@ -234,8 +233,7 @@ discard block |
||
234 | 233 | */ |
235 | 234 | private function notQuery(QueryEntity $queryEntity, string $found, array &$match) |
236 | 235 | { |
237 | - return preg_match('(' . ($found == '/*' ? '\*/' : ($found == '[' ? ']' : |
|
238 | - (preg_match('~^-- |^#~', $found) ? "\n" : preg_quote($found) . "|\\\\."))) . '|$)s', |
|
236 | + return preg_match('(' . ($found == '/*' ? '\*/' : ($found == '[' ? ']' : (preg_match('~^-- |^#~', $found) ? "\n" : preg_quote($found) . "|\\\\."))) . '|$)s', |
|
239 | 237 | $queryEntity->queries, $match, PREG_OFFSET_CAPTURE, $queryEntity->offset) > 0; |
240 | 238 | } |
241 | 239 |
@@ -49,10 +49,10 @@ |
||
49 | 49 | */ |
50 | 50 | public function html($string): string |
51 | 51 | { |
52 | - if(!$string) { |
|
52 | + if (!$string) { |
|
53 | 53 | return ''; |
54 | 54 | } |
55 | - $string = str_replace("\n", '<br>', $string); |
|
55 | + $string = str_replace("\n", '<br>', $string); |
|
56 | 56 | return str_replace("\0", '�', htmlspecialchars($string, ENT_QUOTES, 'utf-8')); |
57 | 57 | } |
58 | 58 |
@@ -65,7 +65,7 @@ discard block |
||
65 | 65 | * |
66 | 66 | * @return boolean |
67 | 67 | */ |
68 | - public function createDatabase(string $database, string $collation) ; |
|
68 | + public function createDatabase(string $database, string $collation); |
|
69 | 69 | |
70 | 70 | /** |
71 | 71 | * Drop a database |
@@ -91,7 +91,7 @@ discard block |
||
91 | 91 | * |
92 | 92 | * @return array |
93 | 93 | */ |
94 | - public function routineLanguages() ; |
|
94 | + public function routineLanguages(); |
|
95 | 95 | |
96 | 96 | /** |
97 | 97 | * Get server variables |
@@ -231,7 +231,7 @@ discard block |
||
231 | 231 | public function applyQueries(string $query, array $tables, $escape = null) |
232 | 232 | { |
233 | 233 | if (!$escape) { |
234 | - $escape = function ($table) { |
|
234 | + $escape = function($table) { |
|
235 | 235 | return $this->table($table); |
236 | 236 | }; |
237 | 237 | } |
@@ -377,7 +377,7 @@ discard block |
||
377 | 377 | { |
378 | 378 | $clauses = []; |
379 | 379 | $wheres = $where["where"] ?? []; |
380 | - foreach ((array) $wheres as $key => $value) { |
|
380 | + foreach ((array)$wheres as $key => $value) { |
|
381 | 381 | $key = $this->util->bracketEscape($key, 1); // 1 - back |
382 | 382 | $column = $this->util->escapeKey($key); |
383 | 383 | $clauses[] = $column . |
@@ -393,7 +393,7 @@ discard block |
||
393 | 393 | } |
394 | 394 | } |
395 | 395 | $nulls = $where["null"] ?? []; |
396 | - foreach ((array) $nulls as $key) { |
|
396 | + foreach ((array)$nulls as $key) { |
|
397 | 397 | $clauses[] = $this->util->escapeKey($key) . " IS NULL"; |
398 | 398 | } |
399 | 399 | return implode(" AND ", $clauses); |