@@ -273,7 +273,7 @@ |
||
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', |
@@ -158,7 +158,7 @@ discard block |
||
158 | 158 | */ |
159 | 159 | public function insertItem(string $table, array $queryOptions): array |
160 | 160 | { |
161 | - list($fields, ,) = $this->getFields($table, $queryOptions); |
|
161 | + list($fields,,) = $this->getFields($table, $queryOptions); |
|
162 | 162 | |
163 | 163 | // From edit.inc.php |
164 | 164 | $values = []; |
@@ -188,7 +188,7 @@ discard block |
||
188 | 188 | */ |
189 | 189 | public function updateItem(string $table, array $queryOptions): array |
190 | 190 | { |
191 | - list($fields, $where, ) = $this->getFields($table, $queryOptions); |
|
191 | + list($fields, $where,) = $this->getFields($table, $queryOptions); |
|
192 | 192 | |
193 | 193 | // From edit.inc.php |
194 | 194 | $indexes = $this->driver->indexes($table); |
@@ -62,8 +62,7 @@ discard block |
||
62 | 62 | private function getEnumItemValue(string $val, int $i, $value): array |
63 | 63 | { |
64 | 64 | $val = stripcslashes(str_replace("''", "'", $val)); |
65 | - $checked = (is_int($value) ? $value == $i + 1 : |
|
66 | - (is_array($value) ? in_array($i+1, $value) : $value === $val)); |
|
65 | + $checked = (is_int($value) ? $value == $i + 1 : (is_array($value) ? in_array($i + 1, $value) : $value === $val)); |
|
67 | 66 | return ['value' => $i + 1, 'checked' => $checked, 'text' => $this->utils->str->html($val)]; |
68 | 67 | } |
69 | 68 | |
@@ -82,7 +81,7 @@ discard block |
||
82 | 81 | 'text' => '<i>' . $this->utils->trans->lang('original') . '</i>']; |
83 | 82 | } |
84 | 83 | if ($field->null) { |
85 | - $values[] = ['value' => '', 'checked' => $value === null && !$select, 'text' => '<i>NULL</i>']; |
|
84 | + $values[] = ['value' => '', 'checked' => $value === null && !$select, 'text' => '<i>NULL</i>']; |
|
86 | 85 | } |
87 | 86 | |
88 | 87 | // From functions.inc.php (function enum_input()) |
@@ -121,7 +121,7 @@ discard block |
||
121 | 121 | if ($row === null) { |
122 | 122 | return !$update && $field->autoIncrement ? "" : (isset($queryOptions["select"]) ? false : $default); |
123 | 123 | } |
124 | - if ($row[$name] != "" && $this->driver->jush() == "sql" && preg_match("~enum|set~", $field->type) ) { |
|
124 | + if ($row[$name] != "" && $this->driver->jush() == "sql" && preg_match("~enum|set~", $field->type)) { |
|
125 | 125 | return is_array($row[$name]) ? array_sum($row[$name]) : +$row[$name]; |
126 | 126 | } |
127 | 127 | return is_bool($row[$name]) ? +$row[$name] : $row[$name]; |
@@ -141,7 +141,7 @@ discard block |
||
141 | 141 | return "SQL"; |
142 | 142 | } |
143 | 143 | if ($queryOptions["save"]) { |
144 | - return (string)$queryOptions["function"][$name]; |
|
144 | + return (string) $queryOptions["function"][$name]; |
|
145 | 145 | } |
146 | 146 | if ($update && preg_match('~^CURRENT_TIMESTAMP~i', $field->onUpdate)) { |
147 | 147 | return 'now'; |
@@ -120,8 +120,7 @@ |
||
120 | 120 | } |
121 | 121 | $foreignKey = $this->foreignKeys[$field->type] ?? null; |
122 | 122 | //! Can collide with user defined type |
123 | - $typeField = ($foreignKey === null ? $field : |
|
124 | - TableFieldEntity::make($this->referencableTables[$foreignKey])); |
|
123 | + $typeField = ($foreignKey === null ? $field : TableFieldEntity::make($this->referencableTables[$foreignKey])); |
|
125 | 124 | $processedField = $this->driver->processField($field, $typeField); |
126 | 125 | $origField = $this->fields[$field->name] ?? null; |
127 | 126 | $this->after = ''; |
@@ -49,8 +49,7 @@ discard block |
||
49 | 49 | $row[$key] = '"' . str_replace('"', '""', $val) . '"'; |
50 | 50 | } |
51 | 51 | } |
52 | - $separator = $this->options['format'] === 'csv' ? ',' : |
|
53 | - ($this->options['format'] === 'tsv' ? "\t" : ';'); |
|
52 | + $separator = $this->options['format'] === 'csv' ? ',' : ($this->options['format'] === 'tsv' ? "\t" : ';'); |
|
54 | 53 | $this->queries[] = implode($separator, $row); |
55 | 54 | } |
56 | 55 | |
@@ -143,7 +142,7 @@ discard block |
||
143 | 142 | } |
144 | 143 | if (!$this->insert) { |
145 | 144 | $this->insert = 'INSERT INTO ' . $this->driver->escapeTableName($table) . ' (' . |
146 | - implode(', ', array_map(function ($key) { |
|
145 | + implode(', ', array_map(function($key) { |
|
147 | 146 | return $this->driver->escapeId($key); |
148 | 147 | }, $keys)) . ') VALUES'; |
149 | 148 | } |
@@ -176,8 +176,7 @@ discard block |
||
176 | 176 | foreach ($grants as $object => $grant) { |
177 | 177 | //! separate db, table, columns, PROCEDURE|FUNCTION, routine |
178 | 178 | $headers[] = $object === '*.*' ? |
179 | - '<input type="hidden" name="objects[' . $i . ']" value="*.*" />*.*' : |
|
180 | - '<input name="objects[' . $i . ']" value="' . $this->utils->str->html($object) . '" autocapitalize="off" />'; |
|
179 | + '<input type="hidden" name="objects[' . $i . ']" value="*.*" />*.*' : '<input name="objects[' . $i . ']" value="' . $this->utils->str->html($object) . '" autocapitalize="off" />'; |
|
181 | 180 | $i++; |
182 | 181 | } |
183 | 182 | |
@@ -230,8 +229,7 @@ discard block |
||
230 | 229 | foreach ($userEntity->grants as $object => $grant) { |
231 | 230 | //! separate db, table, columns, PROCEDURE|FUNCTION, routine |
232 | 231 | $headers[] = $object === '*.*' ? |
233 | - '<input type="hidden" name="objects[' . $i . ']" value="*.*" />*.*' : |
|
234 | - '<input name="objects[' . $i . ']" value="' . |
|
232 | + '<input type="hidden" name="objects[' . $i . ']" value="*.*" />*.*' : '<input name="objects[' . $i . ']" value="' . |
|
235 | 233 | $this->utils->str->html($object) . '" autocapitalize="off" />'; |
236 | 234 | $i++; |
237 | 235 | } |
@@ -247,11 +245,11 @@ discard block |
||
247 | 245 | ], |
248 | 246 | 'pass' => [ |
249 | 247 | 'label' => $this->utils->trans->lang('Password'), |
250 | - 'value' => $userEntity->password , |
|
248 | + 'value' => $userEntity->password, |
|
251 | 249 | ], |
252 | 250 | 'hashed' => [ |
253 | 251 | 'label' => $this->utils->trans->lang('Hashed'), |
254 | - 'value' => ($userEntity->password !== ''), |
|
252 | + 'value' => ($userEntity->password !== ''), |
|
255 | 253 | ], |
256 | 254 | ]; |
257 | 255 |
@@ -49,7 +49,7 @@ discard block |
||
49 | 49 | * @param array $types |
50 | 50 | * |
51 | 51 | * @return array |
52 | - */ |
|
52 | + */ |
|
53 | 53 | protected function values(array $row, array $blobs, array $types): array |
54 | 54 | { |
55 | 55 | $values = []; |
@@ -76,7 +76,7 @@ discard block |
||
76 | 76 | * @param int $limit |
77 | 77 | * |
78 | 78 | * @return string |
79 | - */ |
|
79 | + */ |
|
80 | 80 | private function message($statement, int $limit): string |
81 | 81 | { |
82 | 82 | $numRows = $statement->rowCount(); |
@@ -98,7 +98,7 @@ discard block |
||
98 | 98 | * @param int $limit |
99 | 99 | * |
100 | 100 | * @return array |
101 | - */ |
|
101 | + */ |
|
102 | 102 | protected function select($statement, int $limit = 0): array |
103 | 103 | { |
104 | 104 | // No resultset |
@@ -209,7 +209,7 @@ discard block |
||
209 | 209 | ini_set('memory_limit', max($this->admin->iniBytes('memory_limit'), |
210 | 210 | 2 * strlen($queries) + memory_get_usage() + 8e6)); |
211 | 211 | } |
212 | - catch(\Exception $e) { |
|
212 | + catch (\Exception $e) { |
|
213 | 213 | // Do nothing if the option is not modified. |
214 | 214 | } |
215 | 215 | } |
@@ -252,7 +252,7 @@ discard block |
||
252 | 252 | if ($commands === 0) { |
253 | 253 | $messages[] = $this->utils->trans->lang('No commands to execute.'); |
254 | 254 | } elseif ($onlyErrors) { |
255 | - $messages[] = $this->utils->trans->lang('%d query(s) executed OK.', $commands - $errors); |
|
255 | + $messages[] = $this->utils->trans->lang('%d query(s) executed OK.', $commands - $errors); |
|
256 | 256 | } |
257 | 257 | |
258 | 258 | return [ |
@@ -208,8 +208,7 @@ |
||
208 | 208 | try { |
209 | 209 | ini_set('memory_limit', max($this->admin->iniBytes('memory_limit'), |
210 | 210 | 2 * strlen($queries) + memory_get_usage() + 8e6)); |
211 | - } |
|
212 | - catch(\Exception $e) { |
|
211 | + } catch(\Exception $e) { |
|
213 | 212 | // Do nothing if the option is not modified. |
214 | 213 | } |
215 | 214 | } |
@@ -45,8 +45,7 @@ |
||
45 | 45 | // From table.inc.php |
46 | 46 | $status = $this->status($view); |
47 | 47 | $name = $this->admin->tableName($status); |
48 | - $title = ($status->engine == 'materialized view' ? $this->utils->trans->lang('Materialized view') : |
|
49 | - $this->utils->trans->lang('View')) . ': ' . ($name != '' ? $name : $this->utils->str->html($view)); |
|
48 | + $title = ($status->engine == 'materialized view' ? $this->utils->trans->lang('Materialized view') : $this->utils->trans->lang('View')) . ': ' . ($name != '' ? $name : $this->utils->str->html($view)); |
|
50 | 49 | |
51 | 50 | $comment = $status->comment; |
52 | 51 |