Switch to PSR-4, fix CS and update service provider
This commit is contained in:
28
src/Matchers/InStringMatcher.php
Executable file
28
src/Matchers/InStringMatcher.php
Executable file
@ -0,0 +1,28 @@
|
||||
<?php
|
||||
|
||||
namespace TomLingham\Searchy\Matchers;
|
||||
|
||||
/**
|
||||
* Matches against any occurrences of a string within a string and is case-insensitive.
|
||||
*
|
||||
* For example, a search for 'smi' would match; 'John Smith' or 'Smiley Face'
|
||||
*
|
||||
* Class InStringMatcher
|
||||
*/
|
||||
class InStringMatcher extends BaseMatcher
|
||||
{
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
protected $operator = 'LIKE';
|
||||
|
||||
/**
|
||||
* @param $searchString
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function formatSearchString($searchString)
|
||||
{
|
||||
return "%$searchString%";
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user