[FrameworkBundle] Drop unused private method

This commit is contained in:
Robin Chalas 2019-04-25 15:37:39 +02:00
parent 823d375a95
commit 1e9a9b2c06

View File

@ -249,21 +249,4 @@ EOF
return $max;
}
private function findAlternatives($name, array $collection)
{
$alternatives = [];
foreach ($collection as $item) {
$lev = levenshtein($name, $item);
if ($lev <= \strlen($name) / 3 || false !== strpos($item, $name)) {
$alternatives[$item] = isset($alternatives[$item]) ? $alternatives[$item] - $lev : $lev;
}
}
$threshold = 1e3;
$alternatives = array_filter($alternatives, function ($lev) use ($threshold) { return $lev < 2 * $threshold; });
ksort($alternatives, SORT_NATURAL | SORT_FLAG_CASE);
return array_keys($alternatives);
}
}