minor #31251 [FrameworkBundle] Drop unused private method (chalasr)
This PR was merged into the 4.3-dev branch.
Discussion
----------
[FrameworkBundle] Drop unused private method
| Q | A
| ------------- | ---
| Branch? | master
| Bug fix? | n/a
| New feature? | n/a
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | n/a
| License | MIT
| Doc PR | n/a
Commits
-------
1e9a9b2c06
[FrameworkBundle] Drop unused private method
This commit is contained in:
commit
be80868ba3
@ -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);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user