Passed
Branch main (4f3c5a)
by Thierry
02:54
created
src/DbAdmin/CommandAdmin.php 1 patch
Spacing   +4 added lines, -7 removed lines patch added patch discarded remove patch
@@ -208,9 +208,7 @@  discard block
 block discarded – undo
208 208
 
209 209
         // TODO: Move this to driver implementations
210 210
         $parse = '[\'"' .
211
-            ($this->driver->jush() == "sql" ? '`#' :
212
-            ($this->driver->jush() == "sqlite" ? '`[' :
213
-            ($this->driver->jush() == "mssql" ? '[' : ''))) . ']|/\*|-- |$' .
211
+            ($this->driver->jush() == "sql" ? '`#' : ($this->driver->jush() == "sqlite" ? '`[' : ($this->driver->jush() == "mssql" ? '[' : ''))) . ']|/\*|-- |$' .
214 212
             ($this->driver->jush() == "pgsql" ? '|\$[^$]*\$' : '');
215 213
         // should always match
216 214
         \preg_match('(' . \preg_quote($delimiter) . "\\s*|$parse)", $queries, $match, PREG_OFFSET_CAPTURE, $offset);
@@ -225,8 +223,7 @@  discard block
 block discarded – undo
225 223
             return \intval($pos);
226 224
         }
227 225
         // find matching quote or comment end
228
-        while (\preg_match('(' . ($found == '/*' ? '\*/' : ($found == '[' ? ']' :
229
-            (\preg_match('~^-- |^#~', $found) ? "\n" : \preg_quote($found) . "|\\\\."))) . '|$)s',
226
+        while (\preg_match('(' . ($found == '/*' ? '\*/' : ($found == '[' ? ']' : (\preg_match('~^-- |^#~', $found) ? "\n" : \preg_quote($found) . "|\\\\."))) . '|$)s',
230 227
             $queries, $match, PREG_OFFSET_CAPTURE, $offset)) {
231 228
             //! respect sql_mode NO_BACKSLASH_ESCAPES
232 229
             $s = $match[0][0];
@@ -323,7 +320,7 @@  discard block
 block discarded – undo
323 320
                 \ini_set('memory_limit', \max($this->util->iniBytes('memory_limit'),
324 321
                     2 * \strlen($queries) + \memory_get_usage() + 8e6));
325 322
             }
326
-            catch(\Exception $e) {
323
+            catch (\Exception $e) {
327 324
                 // Do nothing if the option is not modified.
328 325
             }
329 326
         }
@@ -379,7 +376,7 @@  discard block
 block discarded – undo
379 376
         if ($empty) {
380 377
             $messages[] = $this->trans->lang('No commands to execute.');
381 378
         } elseif ($onlyErrors) {
382
-            $messages[] =  $this->trans->lang('%d query(s) executed OK.', $commands - $errors);
379
+            $messages[] = $this->trans->lang('%d query(s) executed OK.', $commands - $errors);
383 380
             // $timestamps[] = $this->trans->formatTime($total_start);
384 381
         }
385 382
 
Please login to merge, or discard this patch.
src/DbAdmin/TableAdmin.php 1 patch
Spacing   +4 added lines, -5 removed lines patch added patch discarded remove patch
@@ -279,14 +279,14 @@  discard block
 block discarded – undo
279 279
                 $target .= '<b>' . $this->util->html($foreignKey->schema) . '</b>.';
280 280
             }
281 281
             $target = $this->util->html($foreignKey->table) .
282
-                '(' . \implode(', ', \array_map(function ($key) {
282
+                '(' . \implode(', ', \array_map(function($key) {
283 283
                     return $this->util->html($key);
284 284
                 }, $foreignKey->target)) . ')';
285 285
             $details[] = [
286 286
                 'name' => $this->util->html($name),
287 287
                 'source' => '<i>' . \implode(
288 288
                     '</i>, <i>',
289
-                    \array_map(function ($key) {
289
+                    \array_map(function($key) {
290 290
                         return $this->util->html($key);
291 291
                     }, $foreignKey->source)
292 292
                 ) . '</i>',
@@ -469,7 +469,7 @@  discard block
 block discarded – undo
469 469
     private function getTableAttrs(array $values, string $table = '', array $origFields = [])
470 470
     {
471 471
         // From create.inc.php
472
-        $values['fields'] = (array)$values['fields'];
472
+        $values['fields'] = (array) $values['fields'];
473 473
         if ($values['autoIncrementCol']) {
474 474
             $values['fields'][$values['autoIncrementCol']]['autoIncrement'] = true;
475 475
         }
@@ -486,8 +486,7 @@  discard block
 block discarded – undo
486 486
             $field = TableFieldEntity::make($field);
487 487
             $foreignKey = $this->foreignKeys[$field->type] ?? null;
488 488
             //! can collide with user defined type
489
-            $typeField = ($foreignKey === null ? $field :
490
-                TableFieldEntity::make($this->referencableTables[$foreignKey]));
489
+            $typeField = ($foreignKey === null ? $field : TableFieldEntity::make($this->referencableTables[$foreignKey]));
491 490
             // Originally, deleted fields have the "field" field set to an empty string.
492 491
             // But in our implementation, the "name" field is not set.
493 492
             if ($field->name != '') {
Please login to merge, or discard this patch.