Passed
Push — main ( 742ea5...16e90c )
by Thierry
09:19 queued 07:12
created
templates/views/bootstrap3/sql/export.php 1 patch
Spacing   +23 added lines, -23 removed lines patch added patch discarded remove patch
@@ -6,10 +6,10 @@  discard block
 block discarded – undo
6 6
                     <label for="output" class="col-md-3 control-label"><?php
7 7
                         echo $this->options['output']['label'] ?></label>
8 8
                     <div class="col-md-8">
9
-<?php foreach($this->options['output']['options'] as $value => $label): ?>
9
+<?php foreach ($this->options['output']['options'] as $value => $label): ?>
10 10
                         <label class="radio-inline">
11 11
                             <input type="radio" name="output" value="<?php echo $value ?>" <?php
12
-                                if($this->options['output']['value'] === $value): ?>checked <?php
12
+                                if ($this->options['output']['value'] === $value): ?>checked <?php
13 13
                                 endif ?>/> <?php echo $label ?>
14 14
                         </label>
15 15
 <?php endforeach ?>
@@ -19,48 +19,48 @@  discard block
 block discarded – undo
19 19
                     <label for="format" class="col-md-3 control-label"><?php
20 20
                         echo $this->options['format']['label'] ?></label>
21 21
                     <div class="col-md-8">
22
-<?php foreach($this->options['format']['options'] as $value => $label): ?>
22
+<?php foreach ($this->options['format']['options'] as $value => $label): ?>
23 23
                         <label class="radio-inline">
24 24
                             <input type="radio" name="format" value="<?php echo $value ?>" <?php
25
-                                if($this->options['format']['value'] === $value): ?>checked <?php
25
+                                if ($this->options['format']['value'] === $value): ?>checked <?php
26 26
                                 endif ?>/> <?php echo $label ?>
27 27
                         </label>
28 28
 <?php endforeach ?>
29 29
                     </div>
30 30
                 </div>
31
-<?php if(array_key_exists('db_style', $this->options)): ?>
31
+<?php if (array_key_exists('db_style', $this->options)): ?>
32 32
                 <div class="form-group">
33 33
                     <label for="db_style" class="col-md-3 control-label"><?php
34 34
                         echo $this->options['db_style']['label'] ?></label>
35 35
                     <div class="col-md-8">
36 36
                         <select name="db_style" class="form-control">
37
-<?php foreach($this->options['db_style']['options'] as $label): ?>
37
+<?php foreach ($this->options['db_style']['options'] as $label): ?>
38 38
                             <option <?php
39
-                                if($this->options['db_style']['value'] == $label): ?>selected<?php
39
+                                if ($this->options['db_style']['value'] == $label): ?>selected<?php
40 40
                                 endif ?>> <?php echo $label ?></option>
41 41
 <?php endforeach ?>
42 42
                         </select>
43 43
                     </div>
44 44
                 </div>
45
-<?php if(array_key_exists('routines', $this->options) || array_key_exists('events', $this->options)): ?>
45
+<?php if (array_key_exists('routines', $this->options) || array_key_exists('events', $this->options)): ?>
46 46
                 <div class="form-group">
47 47
                     <label class="col-md-3 control-label">&nbsp;</label>
48
-<?php if(array_key_exists('routines', $this->options)): ?>
48
+<?php if (array_key_exists('routines', $this->options)): ?>
49 49
                     <div class="col-md-4">
50 50
                         <div class="checkbox">
51 51
                             <label><input type="checkbox" name="routines" value="<?php
52 52
                                 echo $this->options['routines']['value'] ?>" <?php
53
-                                if($this->options['routines']['checked']): ?>checked <?php
53
+                                if ($this->options['routines']['checked']): ?>checked <?php
54 54
                                 endif ?>/> <?php echo $this->options['routines']['label'] ?></label>
55 55
                         </div>
56 56
                     </div>
57 57
 <?php endif ?>
58
-<?php if(array_key_exists('events', $this->options)): ?>
58
+<?php if (array_key_exists('events', $this->options)): ?>
59 59
                     <div class="col-md-4">
60 60
                         <div class="checkbox">
61 61
                             <label><input type="checkbox" name="events" value="<?php
62 62
                                 echo $this->options['events']['value'] ?>" <?php
63
-                                if($this->options['events']['checked']): ?>checked <?php
63
+                                if ($this->options['events']['checked']): ?>checked <?php
64 64
                                 endif ?>/> <?php echo $this->options['events']['label'] ?></label>
65 65
                         </div>
66 66
                     </div>
@@ -73,9 +73,9 @@  discard block
 block discarded – undo
73 73
                         echo $this->options['table_style']['label'] ?></label>
74 74
                     <div class="col-md-8">
75 75
                         <select name="table_style" class="form-control">
76
-<?php foreach($this->options['table_style']['options'] as $label): ?>
76
+<?php foreach ($this->options['table_style']['options'] as $label): ?>
77 77
                             <option <?php
78
-                                if($this->options['table_style']['value'] == $label): ?>selected<?php
78
+                                if ($this->options['table_style']['value'] == $label): ?>selected<?php
79 79
                                 endif ?>> <?php echo $label ?></option>
80 80
 <?php endforeach ?>
81 81
                         </select>
@@ -87,16 +87,16 @@  discard block
 block discarded – undo
87 87
                         <div class="checkbox">
88 88
                             <label><input type="checkbox" name="auto_increment" value="<?php
89 89
                                 echo $this->options['auto_increment']['value'] ?>" <?php
90
-                                if($this->options['auto_increment']['checked']): ?>checked <?php
90
+                                if ($this->options['auto_increment']['checked']): ?>checked <?php
91 91
                                 endif ?>/> <?php echo $this->options['auto_increment']['label'] ?></label>
92 92
                         </div>
93 93
                     </div>
94
-<?php if(array_key_exists('triggers', $this->options)): ?>
94
+<?php if (array_key_exists('triggers', $this->options)): ?>
95 95
                     <div class="col-md-4">
96 96
                         <div class="checkbox">
97 97
                             <label><input type="checkbox" name="triggers" value="<?php
98 98
                                 echo $this->options['triggers']['value'] ?>" <?php
99
-                                if($this->options['triggers']['checked']): ?>checked <?php
99
+                                if ($this->options['triggers']['checked']): ?>checked <?php
100 100
                                 endif ?>/> <?php echo $this->options['triggers']['label'] ?></label>
101 101
                         </div>
102 102
                     </div>
@@ -107,9 +107,9 @@  discard block
 block discarded – undo
107 107
                         echo $this->options['data_style']['label'] ?></label>
108 108
                     <div class="col-md-8">
109 109
                         <select name="data_style" class="form-control">
110
-<?php foreach($this->options['data_style']['options'] as $label): ?>
110
+<?php foreach ($this->options['data_style']['options'] as $label): ?>
111 111
                             <option <?php
112
-                                if($this->options['data_style']['value'] == $label): ?>selected<?php
112
+                                if ($this->options['data_style']['value'] == $label): ?>selected<?php
113 113
                                 endif ?>> <?php echo $label ?></option>
114 114
 <?php endforeach ?>
115 115
                         </select>
@@ -125,7 +125,7 @@  discard block
 block discarded – undo
125 125
             </div>
126 126
             <div class="col-md-4">
127 127
                 <div class="table-responsive">
128
-<?php if(isset($this->databases)): ?>
128
+<?php if (isset($this->databases)): ?>
129 129
                     <table class="table table-bordered">
130 130
                         <thead>
131 131
                             <tr>
@@ -142,7 +142,7 @@  discard block
 block discarded – undo
142 142
                             </tr>
143 143
                         </thead>
144 144
                         <tbody>
145
-<?php foreach($this->databases['details'] as $database): ?>
145
+<?php foreach ($this->databases['details'] as $database): ?>
146 146
                             <tr>
147 147
                                 <td>
148 148
                                     <input type="checkbox" name="database_list[]" class="<?php
@@ -160,7 +160,7 @@  discard block
 block discarded – undo
160 160
                         </tbody>
161 161
                     </table>
162 162
 <?php endif ?>
163
-<?php if(isset($this->tables)): ?>
163
+<?php if (isset($this->tables)): ?>
164 164
                     <table class="table table-bordered">
165 165
                         <thead>
166 166
                             <tr>
@@ -177,7 +177,7 @@  discard block
 block discarded – undo
177 177
                             </tr>
178 178
                         </thead>
179 179
                         <tbody>
180
-<?php foreach($this->tables['details'] as $table): ?>
180
+<?php foreach ($this->tables['details'] as $table): ?>
181 181
                             <tr>
182 182
                                 <td>
183 183
                                     <input type="checkbox" name="table_list[]" class="<?php
Please login to merge, or discard this patch.
templates/views/bootstrap3/sql/results.php 1 patch
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -1,44 +1,44 @@
 block discarded – undo
1
-<?php foreach($this->results as $result): ?>
1
+<?php foreach ($this->results as $result): ?>
2 2
             <div class="row">
3
-<?php if(count($result['errors']) > 0): ?>
3
+<?php if (count($result['errors']) > 0): ?>
4 4
                 <div class="panel panel-danger">
5 5
                     <div class="panel-heading">
6 6
                         <?php echo $result['query'] ?>
7 7
                     </div>
8 8
                     <div class="panel-body" style="padding:5px 15px">
9
-<?php foreach($result['errors'] as $error): ?>
9
+<?php foreach ($result['errors'] as $error): ?>
10 10
                         <p style="margin:0"><?php echo $error ?></p>
11 11
 <?php endforeach ?>
12 12
                     </div>
13 13
                 </div>
14 14
 <?php endif ?>
15
-<?php if(count($result['messages']) > 0): ?>
15
+<?php if (count($result['messages']) > 0): ?>
16 16
                 <div class="panel panel-info">
17 17
                     <div class="panel-heading">
18 18
                         <?php echo $result['query'] ?>
19 19
                     </div>
20 20
                     <div class="panel-body" style="padding:5px 15px">
21
-<?php foreach($result['messages'] as $message): ?>
21
+<?php foreach ($result['messages'] as $message): ?>
22 22
                         <p style="margin:0"><?php echo $message ?></p>
23 23
 <?php endforeach ?>
24 24
                     </div>
25 25
                 </div>
26 26
 <?php endif ?>
27 27
 
28
-<?php if(($result['select'])): ?>
28
+<?php if (($result['select'])): ?>
29 29
                 <div class="table-responsive">
30 30
                     <table class="table table-bordered">
31 31
                         <thead>
32 32
                             <tr>
33
-<?php foreach($result['select']['headers'] as $header): ?>
33
+<?php foreach ($result['select']['headers'] as $header): ?>
34 34
                                 <th><?php echo $header ?></th>
35 35
 <?php endforeach ?>
36 36
                             </tr>
37 37
                         </thead>
38 38
                         <tbody>
39
-<?php foreach($result['select']['details'] as $details): ?>
39
+<?php foreach ($result['select']['details'] as $details): ?>
40 40
                             <tr>
41
-<?php foreach($details as $detail): ?>
41
+<?php foreach ($details as $detail): ?>
42 42
                                 <td><?php echo $detail ?></td>
43 43
 <?php endforeach ?>
44 44
                             </tr>
Please login to merge, or discard this patch.
translations/gl.inc.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -273,7 +273,7 @@
 block discarded – undo
273 273
     'Modify' => 'Modificar',
274 274
     'Loading' => 'Cargando',
275 275
     'Load more data' => 'Cargar máis datos',
276
-    '%d / ' => array('%d / ','%d / '),
276
+    '%d / ' => array('%d / ', '%d / '),
277 277
     'Limit rows' => 'Limitar filas',
278 278
     'Default value' => 'Valor por defecto',
279 279
     'Full table scan' => 'Escaneo completo da táboa',
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
@@ -273,14 +273,14 @@  discard block
 block discarded – undo
273 273
                 $target .= '<b>' . $this->util->html($foreignKey->schema) . '</b>.';
274 274
             }
275 275
             $target = $this->util->html($foreignKey->table) .
276
-                '(' . \implode(', ', \array_map(function ($key) {
276
+                '(' . \implode(', ', \array_map(function($key) {
277 277
                     return $this->util->html($key);
278 278
                 }, $foreignKey->target)) . ')';
279 279
             $details[] = [
280 280
                 'name' => $this->util->html($name),
281 281
                 'source' => '<i>' . \implode(
282 282
                     '</i>, <i>',
283
-                    \array_map(function ($key) {
283
+                    \array_map(function($key) {
284 284
                         return $this->util->html($key);
285 285
                     }, $foreignKey->source)
286 286
                 ) . '</i>',
@@ -464,7 +464,7 @@  discard block
 block discarded – undo
464 464
     private function createOrAlterTable(array $values, string $table = '', array $origFields = [])
465 465
     {
466 466
         // From create.inc.php
467
-        $values['fields'] = (array)$values['fields'];
467
+        $values['fields'] = (array) $values['fields'];
468 468
         if ($values['autoIncrementCol']) {
469 469
             $values['fields'][$values['autoIncrementCol']]['autoIncrement'] = true;
470 470
         }
@@ -483,8 +483,7 @@  discard block
 block discarded – undo
483 483
             $field = TableFieldEntity::make($field);
484 484
             $foreignKey = $this->foreignKeys[$field->type] ?? null;
485 485
             //! can collide with user defined type
486
-            $typeField = ($foreignKey === null ? $field :
487
-                TableFieldEntity::make($this->referencableTables[$foreignKey]));
486
+            $typeField = ($foreignKey === null ? $field : TableFieldEntity::make($this->referencableTables[$foreignKey]));
488 487
             // Originally, deleted fields have the "field" field set to an empty string.
489 488
             // But in our implementation, the "name" field is not set.
490 489
             if ($field->name != '') {
Please login to merge, or discard this patch.
src/DbAdmin/UserAdmin.php 1 patch
Spacing   +4 added lines, -6 removed lines patch added patch discarded remove patch
@@ -60,8 +60,7 @@  discard block
 block discarded – undo
60 60
         foreach ($grants as $object => $grant) {
61 61
             //! separate db, table, columns, PROCEDURE|FUNCTION, routine
62 62
             $headers[] = $object === '*.*' ?
63
-                '<input type="hidden" name="objects[' . $i . ']" value="*.*" />*.*' :
64
-                '<input name="objects[' . $i . ']" value="' . $this->util->html($object) . '" autocapitalize="off" />';
63
+                '<input type="hidden" name="objects[' . $i . ']" value="*.*" />*.*' : '<input name="objects[' . $i . ']" value="' . $this->util->html($object) . '" autocapitalize="off" />';
65 64
             $i++;
66 65
         }
67 66
 
@@ -116,8 +115,7 @@  discard block
 block discarded – undo
116 115
         foreach ($grants as $object => $grant) {
117 116
             //! separate db, table, columns, PROCEDURE|FUNCTION, routine
118 117
             $headers[] = $object === '*.*' ?
119
-                '<input type="hidden" name="objects[' . $i . ']" value="*.*" />*.*' :
120
-                '<input name="objects[' . $i . ']" value="' .
118
+                '<input type="hidden" name="objects[' . $i . ']" value="*.*" />*.*' : '<input name="objects[' . $i . ']" value="' .
121 119
                     $this->util->html($object) . '" autocapitalize="off" />';
122 120
             $i++;
123 121
         }
@@ -135,11 +133,11 @@  discard block
 block discarded – undo
135 133
             ],
136 134
             'pass' => [
137 135
                 'label' => $this->trans->lang('Password'),
138
-                'value' => $password ,
136
+                'value' => $password,
139 137
             ],
140 138
             'hashed' => [
141 139
                 'label' => $this->trans->lang('Hashed'),
142
-                'value' => ($password  != ''),
140
+                'value' => ($password != ''),
143 141
             ],
144 142
         ];
145 143
 
Please login to merge, or discard this patch.
src/DbAdmin/CommandAdmin.php 3 patches
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -43,7 +43,7 @@
 block discarded – undo
43 43
      * @param int
44 44
      *
45 45
      * @return array
46
-    */
46
+     */
47 47
     protected function select($statement, $orgtables = [], $limit = 0)
48 48
     {
49 49
         $links = []; // colno => orgtable - create links from these columns
Please login to merge, or discard this patch.
Spacing   +5 added lines, -9 removed lines patch added patch discarded remove patch
@@ -96,8 +96,7 @@  discard block
 block discarded – undo
96 96
         if ($rowCount > 0) {
97 97
             $numRows = $statement->rowCount();
98 98
             $message = ($numRows ? ($limit && $numRows > $limit ?
99
-                $this->trans->lang('%d / ', $limit) :
100
-                "") . $this->trans->lang('%d row(s)', $numRows) : "");
99
+                $this->trans->lang('%d / ', $limit) : "") . $this->trans->lang('%d row(s)', $numRows) : "");
101 100
         }
102 101
 
103 102
         // Table header
@@ -158,7 +157,7 @@  discard block
 block discarded – undo
158 157
                 \ini_set("memory_limit", \max($this->util->iniBytes("memory_limit"),
159 158
                     2 * \strlen($queries) + \memory_get_usage() + 8e6));
160 159
             }
161
-            catch(\Exception $e) {
160
+            catch (\Exception $e) {
162 161
                 // Do nothing if the option is not modified.
163 162
             }
164 163
         }
@@ -182,9 +181,7 @@  discard block
 block discarded – undo
182 181
         $timestamps = [];
183 182
         // TODO: Move this to driver implementations
184 183
         $parse = '[\'"' .
185
-            ($this->driver->jush() == "sql" ? '`#' :
186
-            ($this->driver->jush() == "sqlite" ? '`[' :
187
-            ($this->driver->jush() == "mssql" ? '[' : ''))) . ']|/\*|-- |$' .
184
+            ($this->driver->jush() == "sql" ? '`#' : ($this->driver->jush() == "sqlite" ? '`[' : ($this->driver->jush() == "mssql" ? '[' : ''))) . ']|/\*|-- |$' .
188 185
             ($this->driver->jush() == "pgsql" ? '|\$[^$]*\$' : '');
189 186
         // $total_start = \microtime(true);
190 187
         // \parse_str($_COOKIE["adminer_export"], $adminer_export);
@@ -211,8 +208,7 @@  discard block
 block discarded – undo
211 208
 
212 209
             if ($found && \rtrim($found) != $delimiter) {
213 210
                 // find matching quote or comment end
214
-                while (\preg_match('(' . ($found == '/*' ? '\*/' : ($found == '[' ? ']' :
215
-                    (\preg_match('~^-- |^#~', $found) ? "\n" : \preg_quote($found) .
211
+                while (\preg_match('(' . ($found == '/*' ? '\*/' : ($found == '[' ? ']' : (\preg_match('~^-- |^#~', $found) ? "\n" : \preg_quote($found) .
216 212
                     "|\\\\."))) . '|$)s', $queries, $match, PREG_OFFSET_CAPTURE, $offset)) {
217 213
                     //! respect sql_mode NO_BACKSLASH_ESCAPES
218 214
                     $s = $match[0][0];
@@ -306,7 +302,7 @@  discard block
 block discarded – undo
306 302
         if ($empty) {
307 303
             $messages[] = $this->trans->lang('No commands to execute.');
308 304
         } elseif ($onlyErrors) {
309
-            $messages[] =  $this->trans->lang('%d query(s) executed OK.', $commands - \count($errors));
305
+            $messages[] = $this->trans->lang('%d query(s) executed OK.', $commands - \count($errors));
310 306
             // $timestamps[] = $this->trans->formatTime($total_start);
311 307
         }
312 308
         // elseif($errors && $commands > 1)
Please login to merge, or discard this patch.
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -157,8 +157,7 @@
 block discarded – undo
157 157
             try {
158 158
                 \ini_set("memory_limit", \max($this->util->iniBytes("memory_limit"),
159 159
                     2 * \strlen($queries) + \memory_get_usage() + 8e6));
160
-            }
161
-            catch(\Exception $e) {
160
+            } catch(\Exception $e) {
162 161
                 // Do nothing if the option is not modified.
163 162
             }
164 163
         }
Please login to merge, or discard this patch.
src/Package.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -198,7 +198,7 @@  discard block
 block discarded – undo
198 198
     {
199 199
         $servers = $this->getConfig()->getOption('servers', []);
200 200
         $default = $this->getConfig()->getOption('default', '');
201
-        if(\array_key_exists($default, $servers))
201
+        if (\array_key_exists($default, $servers))
202 202
         {
203 203
             return $default;
204 204
         }
@@ -237,7 +237,7 @@  discard block
 block discarded – undo
237 237
      */
238 238
     public function getReadyScript()
239 239
     {
240
-        if(!($server = $this->getDefaultServer()))
240
+        if (!($server = $this->getDefaultServer()))
241 241
         {
242 242
             return '';
243 243
         }
Please login to merge, or discard this patch.
src/Db/Translator.php 1 patch
Spacing   +2 added lines, -4 removed lines patch added patch discarded remove patch
@@ -127,11 +127,9 @@
 block discarded – undo
127 127
                 // different forms for 1, 2-4 except 12-14, other
128 128
                 : ($this->language == 'pl' ? ($number % 10 > 1 && $number % 10 < 5 && $number / 10 % 10 != 1 ? 1 : 2)
129 129
                 // different forms for 1, 2, 3-4, other
130
-                : ($this->language == 'sl' ? ($number % 100 == 1 ? 0 : ($number % 100 == 2 ? 1 :
131
-                    ($number % 100 == 3 || $number % 100 == 4 ? 2 : 3)))
130
+                : ($this->language == 'sl' ? ($number % 100 == 1 ? 0 : ($number % 100 == 2 ? 1 : ($number % 100 == 3 || $number % 100 == 4 ? 2 : 3)))
132 131
                 // different forms for 1, 12-19, other
133
-                : ($this->language == 'lt' ? ($number % 10 == 1 && $number % 100 != 11 ? 0 :
134
-                    ($number % 10 > 1 && $number / 10 % 10 != 1 ? 1 : 2))
132
+                : ($this->language == 'lt' ? ($number % 10 == 1 && $number % 100 != 11 ? 0 : ($number % 10 > 1 && $number / 10 % 10 != 1 ? 1 : 2))
135 133
                 // different forms for 1 except 11, 2-4 except 12-14, other
136 134
                 : ($this->language == 'bs' || $this->language == 'ru' || $this->language == 'sr' || $this->language == 'uk' ?
137 135
                     ($number % 10 == 1 && $number % 100 != 11 ? 0
Please login to merge, or discard this patch.
config/config.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -5,7 +5,7 @@
 block discarded – undo
5 5
         __DIR__ . '/../app/Ajax' => [
6 6
             'namespace' => 'Lagdo\\DbAdmin\\App\\Ajax',
7 7
             'autoload' => false,
8
-            'classes' => require( __DIR__ . '/classes.php'),
8
+            'classes' => require(__DIR__ . '/classes.php'),
9 9
         ],
10 10
     ],
11 11
     'views' => [
Please login to merge, or discard this patch.