1
0
mirror of https://github.com/dg/dibi.git synced 2025-08-06 14:16:39 +02:00

Dibi\Helpers::getSuggestion(): item may be an int, type cast fix (#378)

This commit is contained in:
David Grudl
2020-10-14 11:58:54 +02:00
parent 24d0b069d8
commit e4b6e769ee

View File

@@ -143,6 +143,7 @@ class Helpers
{
$best = null;
$min = (strlen($value) / 4 + 1) * 10 + .1;
$items = array_map('strval', $items);
foreach (array_unique($items) as $item) {
if (($len = levenshtein($item, $value, 10, 11, 10)) > 0 && $len < $min) {
$min = $len;