Switch to PSR-4, fix CS and update service provider
This commit is contained in:
24
src/Matchers/LevenshteinMatcher.php
Executable file
24
src/Matchers/LevenshteinMatcher.php
Executable file
@ -0,0 +1,24 @@
|
||||
<?php
|
||||
|
||||
namespace TomLingham\Searchy\Matchers;
|
||||
|
||||
/**
|
||||
* Matches strings for Acronym 'like' matches but does NOT return Studly Case Matches.
|
||||
*
|
||||
* for example, a search for 'fb' would match; 'foo bar' or 'Fred Brown' but not 'FreeBeer'.
|
||||
*
|
||||
* Class AcronymMatcher
|
||||
*/
|
||||
class LevenshteinMatcher extends BaseMatcher
|
||||
{
|
||||
/**
|
||||
* @param $column
|
||||
* @param $searchString
|
||||
*
|
||||
* @return mixed|string
|
||||
*/
|
||||
public function buildQueryString($column, $searchString)
|
||||
{
|
||||
return "levenshtein($column, '$searchString')";
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user