vaened /
laravel-searcher
| 1 | <?php |
||
| 2 | /** |
||
| 3 | * Created by enea dhack - 12/07/2020 19:29. |
||
| 4 | */ |
||
| 5 | |||
| 6 | namespace Vaened\Searcher\Keywords; |
||
| 7 | |||
| 8 | use Vaened\Enum\Enum; |
||
| 9 | |||
| 10 | /** |
||
| 11 | * Class Wildcard |
||
| 12 | * |
||
| 13 | * @package Vaened\Searcher |
||
| 14 | * @author enea dhack <[email protected]> |
||
| 15 | * |
||
| 16 | * @method static Wildcard LEFT() |
||
| 17 | * @method static Wildcard RIGHT() |
||
| 18 | * @method static Wildcard BOTH() |
||
| 19 | */ |
||
| 20 | final class Wildcard extends Enum |
||
|
0 ignored issues
–
show
Bug
introduced
by
Loading history...
|
|||
| 21 | { |
||
| 22 | public const LEFT = '%%%s'; |
||
| 23 | |||
| 24 | public const RIGHT = '%s%%'; |
||
| 25 | |||
| 26 | public const BOTH = '%%%s%%'; |
||
| 27 | |||
| 28 | public function apply(string $q): string |
||
| 29 | { |
||
| 30 | return sprintf($this->value(), $q); |
||
| 31 | } |
||
| 32 | } |
||
| 33 | |||
| 34 |