| @@ -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', | 
| @@ -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 | 
| @@ -46,7 +46,7 @@ discard block | ||
| 46 | 46 | * @param LoggingService|null $logging | 
| 47 | 47 | */ | 
| 48 | 48 | public function __construct(AbstractFacade $dbFacade, | 
| 49 | - protected TimerService $timer, protected LoggingService|null $logging) | |
| 49 | + protected TimerService $timer, protected LoggingService | null $logging) | |
| 50 | 50 |      { | 
| 51 | 51 | parent::__construct($dbFacade); | 
| 52 | 52 | } | 
| @@ -226,7 +226,7 @@ discard block | ||
| 226 | 226 |                  ini_set('memory_limit', max($this->admin->iniBytes('memory_limit'), | 
| 227 | 227 | 2 * strlen($queries) + memory_get_usage() + 8e6)); | 
| 228 | 228 | } | 
| 229 | -            catch(\Exception $e) { | |
| 229 | +            catch (\Exception $e) { | |
| 230 | 230 | // Do nothing if the option is not modified. | 
| 231 | 231 | } | 
| 232 | 232 | } | 
| @@ -253,7 +253,7 @@ discard block | ||
| 253 | 253 |          if ($commands === 0) { | 
| 254 | 254 |              $messages[] = $this->utils->trans->lang('No commands to execute.'); | 
| 255 | 255 |          } elseif ($onlyErrors) { | 
| 256 | -            $messages[] =  $this->utils->trans->lang('%d query(s) executed OK.', $commands - $errors); | |
| 256 | +            $messages[] = $this->utils->trans->lang('%d query(s) executed OK.', $commands - $errors); | |
| 257 | 257 | } | 
| 258 | 258 | return [ | 
| 259 | 259 | 'results' => $this->results, | 
| @@ -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 | |
| @@ -200,14 +200,14 @@ | ||
| 200 | 200 | $target .= '<b>' . $this->utils->str->html($foreignKey->schema) . '</b>.'; | 
| 201 | 201 | } | 
| 202 | 202 | $target = $this->utils->str->html($foreignKey->table) . | 
| 203 | -                '(' . implode(', ', array_map(function ($key) { | |
| 203 | +                '(' . implode(', ', array_map(function($key) { | |
| 204 | 204 | return $this->utils->str->html($key); | 
| 205 | 205 | }, $foreignKey->target)) . ')'; | 
| 206 | 206 | $details[] = [ | 
| 207 | 207 | 'name' => $this->utils->str->html($name), | 
| 208 | 208 | 'source' => '<i>' . implode( | 
| 209 | 209 | '</i>, <i>', | 
| 210 | -                    array_map(function ($key) { | |
| 210 | +                    array_map(function($key) { | |
| 211 | 211 | return $this->utils->str->html($key); | 
| 212 | 212 | }, $foreignKey->source) | 
| 213 | 213 | ) . '</i>', |