Skip to content
Snippets Groups Projects

Issue #3427068: Fix cspell errors

All threads resolved!
Files
31
@@ -801,15 +801,15 @@ class Database extends BackendPluginBase implements AutocompleteBackendInterface
* A column name that isn't in use in the specified table yet.
*/
protected function findFreeColumn($table, $column) {
$maxbytes = 62;
$max_bytes = 62;
$base = $name = Unicode::truncateBytes(mb_strtolower(preg_replace('/[^a-z0-9]/i', '_', $column)), $maxbytes);
$base = $name = Unicode::truncateBytes(mb_strtolower(preg_replace('/[^a-z0-9]/i', '_', $column)), $max_bytes);
// If the table does not exist yet, the initial name is not taken.
if ($this->database->schema()->tableExists($table)) {
$i = 0;
while ($this->database->schema()->fieldExists($table, $name)) {
$suffix = '_' . ++$i;
$name = Unicode::truncateBytes($base, $maxbytes - strlen($suffix)) . $suffix;
$name = Unicode::truncateBytes($base, $max_bytes - strlen($suffix)) . $suffix;
}
}
return $name;
@@ -1064,15 +1064,15 @@ class Database extends BackendPluginBase implements AutocompleteBackendInterface
$multiplier = $new_fields[$field_id]->getBoost() / $field['boost'];
// Postgres doesn't allow multiplying an integer column with a
// float literal, so we have to work around that.
$expression = 'score * :mult';
$expression = 'score * :multiplier';
$args = [
':mult' => $multiplier,
':multiplier' => $multiplier,
];
if (is_float($multiplier) && $pos = strpos("$multiplier", '.')) {
$expression .= ' / :div';
$after_point_digits = strlen("$multiplier") - $pos - 1;
$args[':div'] = pow(10, min(3, $after_point_digits));
$args[':mult'] = (int) round($args[':mult'] * $args[':div']);
$args[':multiplier'] = (int) round($args[':multiplier'] * $args[':div']);
}
$this->database->update($text_table)
->expression('score', $expression, $args)
@@ -2041,8 +2041,8 @@ class Database extends BackendPluginBase implements AutocompleteBackendInterface
if (is_array($nested) && $neg == !empty($nested['#negation'])) {
if ($nested['#conjunction'] == $conj) {
unset($nested['#conjunction'], $nested['#negation']);
foreach ($nested as $renested) {
$keys[] = $renested;
foreach ($nested as $nested_key) {
$keys[] = $nested_key;
}
unset($keys[$i]);
}
@@ -3053,9 +3053,9 @@ class Database extends BackendPluginBase implements AutocompleteBackendInterface
->having('COUNT(DISTINCT [t].[item_id]) <= :max', [':max' => $max_occurrences])
->orderBy('results', 'DESC')
->range(0, $limit);
$incomp_len = strlen($incomplete_key);
$incomplete_key_len = strlen($incomplete_key);
foreach ($db_query->execute() as $row) {
$suffix = ($pass == 1) ? substr($row->word, $incomp_len) : ' ' . $row->word;
$suffix = ($pass == 1) ? substr($row->word, $incomplete_key_len) : ' ' . $row->word;
$suggestions[] = $factory->createFromSuggestionSuffix($suffix, $row->results);
}
}
Loading