Passed
Push — main ( b963ae...3e7f40 )
by Thierry
02:05
created
templates/views/bootstrap3/html/select-key.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1,5 +1,5 @@
 block discarded – undo
1 1
 <select class="form-control">
2
-<?php foreach($this->options as $value => $label): ?>
2
+<?php foreach ($this->options as $value => $label): ?>
3 3
     <option value="<?php echo htmlentities($value) ?>"><?php echo $label ?></option>
4 4
 <?php endforeach ?>
5 5
 </select>
Please login to merge, or discard this patch.
templates/views/bootstrap3/menu/schemas.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -1,7 +1,7 @@
 block discarded – undo
1 1
                 <div class="input-group">
2
-<?php if(isset($this->schemas) && ($this->schemas)): ?>
2
+<?php if (isset($this->schemas) && ($this->schemas)): ?>
3 3
                     <select class="form-control" id="adminer-schema-select">
4
-<?php foreach($this->schemas as $schema): ?>
4
+<?php foreach ($this->schemas as $schema): ?>
5 5
                         <option value="<?php echo $schema ?>"><?php echo $schema ?></option>
6 6
 <?php endforeach ?>
7 7
                     </select>
Please login to merge, or discard this patch.
src/Db/Admin.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -139,7 +139,7 @@
 block discarded – undo
139 139
                     }
140 140
                 }
141 141
                 if (\preg_match("~ IDENTIFIED BY PASSWORD '([^']+)~", $row[0], $match)) {
142
-                    $password  = $match[1];
142
+                    $password = $match[1];
143 143
                 }
144 144
             }
145 145
         }
Please login to merge, or discard this patch.
src/DbAdmin/ViewTrait.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -52,7 +52,7 @@
 block discarded – undo
52 52
             $this->viewAdmin = new ViewAdmin();
53 53
             $this->viewAdmin->init($this->admin());
54 54
         }
55
-        return $this->viewAdmin ;
55
+        return $this->viewAdmin;
56 56
     }
57 57
 
58 58
     /**
Please login to merge, or discard this patch.
src/DbAdmin/ExportAdmin.php 2 patches
Spacing   +2 added lines, -3 removed lines patch added patch discarded remove patch
@@ -239,8 +239,7 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
                         }
Please login to merge, or discard this patch.
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -526,8 +526,7 @@
 block discarded – undo
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
         }
Please login to merge, or discard this patch.
src/DbAdmin/TableSelectAdmin.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -23,7 +23,7 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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,
Please login to merge, or discard this patch.
src/Db/Util.php 2 patches
Braces   +2 added lines, -4 removed lines patch added patch discarded remove patch
@@ -924,11 +924,9 @@
 block discarded – undo
924 924
         if ($link === '') {
925 925
             if ($this->isMail($value)) {
926 926
                 $link = "mailto:$value";
927
-            }
928
-            elseif ($this->isUrl($value)) {
927
+            } elseif ($this->isUrl($value)) {
929 928
                 $link = $value; // IE 11 and all modern browsers hide referrer
930
-            }
931
-            else {
929
+            } else {
932 930
                 $link = '';
933 931
             }
934 932
         }
Please login to merge, or discard this patch.
Spacing   +5 added lines, -8 removed lines patch added patch discarded remove patch
@@ -449,9 +449,8 @@  discard block
 block discarded – undo
449 449
         \preg_match_all("~'((?:[^']|'')*)'~", $field->length, $matches);
450 450
         foreach ($matches[1] as $i => $val) {
451 451
             $val = \stripcslashes(\str_replace("''", "'", $val));
452
-            $checked = (\is_int($value) ? $value == $i + 1 :
453
-                (\is_array($value) ? \in_array($i+1, $value) : $value === $val));
454
-            $inputs[] = "<label><input type='$type'$attrs value='" . ($i+1) . "'" .
452
+            $checked = (\is_int($value) ? $value == $i + 1 : (\is_array($value) ? \in_array($i + 1, $value) : $value === $val));
453
+            $inputs[] = "<label><input type='$type'$attrs value='" . ($i + 1) . "'" .
455 454
                 ($checked ? ' checked' : '') . '>' . $this->html($val) . '</label>';
456 455
         }
457 456
 
@@ -515,8 +514,7 @@  discard block
 block discarded – undo
515 514
         }
516 515
         $enumLength = $this->driver->enumLength();
517 516
         return (\preg_match("~^\\s*\\(?\\s*$enumLength(?:\\s*,\\s*$enumLength)*+\\s*\\)?\\s*\$~", $length) &&
518
-            \preg_match_all("~$enumLength~", $length, $matches) ? '(' . \implode(',', $matches[0]) . ')' :
519
-            \preg_replace('~^[0-9].*~', '(\0)', \preg_replace('~[^-0-9,+()[\]]~', '', $length))
517
+            \preg_match_all("~$enumLength~", $length, $matches) ? '(' . \implode(',', $matches[0]) . ')' : \preg_replace('~^[0-9].*~', '(\0)', \preg_replace('~[^-0-9,+()[\]]~', '', $length))
520 518
         );
521 519
     }
522 520
 
@@ -703,7 +701,7 @@  discard block
 block discarded – undo
703 701
         $expressions = [];
704 702
         foreach ($indexes as $i => $index) {
705 703
             if ($index->type == 'FULLTEXT' && $this->input->values['fulltext'][$i] != '') {
706
-                $columns = \array_map(function ($column) {
704
+                $columns = \array_map(function($column) {
707 705
                     return $this->driver->escapeId($column);
708 706
                 }, $index->columns);
709 707
                 $expressions[] = 'MATCH (' . \implode(', ', $columns) . ') AGAINST (' .
@@ -818,8 +816,7 @@  discard block
 block discarded – undo
818 816
      */
819 817
     private function _selectValue($value, string $link, string $type, $original)
820 818
     {
821
-        $clause = ($value === null ? '<i>NULL</i>' :
822
-            (\preg_match('~char|binary|boolean~', $type) && !\preg_match('~var~', $type) ?
819
+        $clause = ($value === null ? '<i>NULL</i>' : (\preg_match('~char|binary|boolean~', $type) && !\preg_match('~var~', $type) ?
823 820
             "<code>$value</code>" : $value));
824 821
         if (\preg_match('~blob|bytea|raw|file~', $type) && !$this->isUtf8($value)) {
825 822
             $clause = '<i>' . $this->trans->lang('%d byte(s)', \strlen($original)) . '</i>';
Please login to merge, or discard this patch.
src/DbAdmin/CommandAdmin.php 3 patches
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -325,8 +325,7 @@
 block discarded – undo
325 325
             try {
326 326
                 \ini_set('memory_limit', \max($this->util->iniBytes('memory_limit'),
327 327
                     2 * \strlen($queries) + \memory_get_usage() + 8e6));
328
-            }
329
-            catch(\Exception $e) {
328
+            } catch(\Exception $e) {
330 329
                 // Do nothing if the option is not modified.
331 330
             }
332 331
         }
Please login to merge, or discard this patch.
Indentation   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -46,7 +46,7 @@  discard block
 block discarded – undo
46 46
      * @param array $types
47 47
      *
48 48
      * @return string
49
-    */
49
+     */
50 50
     protected function values(array $row, array $blobs, array $types)
51 51
     {
52 52
         $values = [];
@@ -73,7 +73,7 @@  discard block
 block discarded – undo
73 73
      * @param int $limit
74 74
      *
75 75
      * @return string
76
-    */
76
+     */
77 77
     private function message($statement, int $limit)
78 78
     {
79 79
         $numRows = $statement->rowCount();
@@ -95,7 +95,7 @@  discard block
 block discarded – undo
95 95
      * @param int $limit
96 96
      *
97 97
      * @return array
98
-    */
98
+     */
99 99
     protected function select($statement, $limit = 0)
100 100
     {
101 101
         // No resultset
Please login to merge, or discard this patch.
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -196,7 +196,7 @@  discard block
 block discarded – undo
196 196
                 \ini_set('memory_limit', \max($this->util->iniBytes('memory_limit'),
197 197
                     2 * \strlen($queries) + \memory_get_usage() + 8e6));
198 198
             }
199
-            catch(\Exception $e) {
199
+            catch (\Exception $e) {
200 200
                 // Do nothing if the option is not modified.
201 201
             }
202 202
         }
@@ -235,7 +235,7 @@  discard block
 block discarded – undo
235 235
         if ($commands === 0) {
236 236
             $messages[] = $this->trans->lang('No commands to execute.');
237 237
         } elseif ($onlyErrors) {
238
-            $messages[] =  $this->trans->lang('%d query(s) executed OK.', $commands - $errors);
238
+            $messages[] = $this->trans->lang('%d query(s) executed OK.', $commands - $errors);
239 239
         }
240 240
 
241 241
         return ['results' => $this->results, 'messages' => $messages];
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
@@ -299,14 +299,14 @@  discard block
 block discarded – undo
299 299
                 $target .= '<b>' . $this->util->html($foreignKey->schema) . '</b>.';
300 300
             }
301 301
             $target = $this->util->html($foreignKey->table) .
302
-                '(' . \implode(', ', \array_map(function ($key) {
302
+                '(' . \implode(', ', \array_map(function($key) {
303 303
                     return $this->util->html($key);
304 304
                 }, $foreignKey->target)) . ')';
305 305
             $details[] = [
306 306
                 'name' => $this->util->html($name),
307 307
                 'source' => '<i>' . \implode(
308 308
                     '</i>, <i>',
309
-                    \array_map(function ($key) {
309
+                    \array_map(function($key) {
310 310
                         return $this->util->html($key);
311 311
                     }, $foreignKey->source)
312 312
                 ) . '</i>',
@@ -486,8 +486,7 @@  discard block
 block discarded – undo
486 486
     {
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
         $processedField = $this->util->processField($field, $typeField);
492 491
         $origField = $this->fields[$this->fieldName] ?? null;
493 492
         if ($this->fieldName === '') {
@@ -569,7 +568,7 @@  discard block
 block discarded – undo
569 568
     private function makeTableAttrs(array $values, string $table = '')
570 569
     {
571 570
         // From create.inc.php
572
-        $values['fields'] = (array)$values['fields'];
571
+        $values['fields'] = (array) $values['fields'];
573 572
         if ($values['autoIncrementCol']) {
574 573
             $values['fields'][$values['autoIncrementCol']]['autoIncrement'] = true;
575 574
         }
Please login to merge, or discard this patch.