| Conditions | 2 |
| Paths | 2 |
| Total Lines | 14 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 37 | public static function findSimilarText(array $strings, string $input): ?string |
||
| 38 | { |
||
| 39 | if (empty($strings)) { |
||
| 40 | return null; |
||
| 41 | } |
||
| 42 | |||
| 43 | return Collection::make($strings) |
||
| 44 | ->sortByDesc(function (string $string) use ($input) { |
||
| 45 | similar_text($input, $string, $percentage); |
||
| 46 | |||
| 47 | return $percentage; |
||
| 48 | }) |
||
| 49 | ->first(); |
||
| 50 | } |
||
| 51 | } |
||
| 52 |