Completed
Push — master ( ceee37...536973 )
by Enea
02:33
created

Wildcard   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 11
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 5
dl 0
loc 11
rs 10
c 0
b 0
f 0
wmc 1

1 Method

Rating   Name   Duplication   Size   Complexity  
A apply() 0 3 1
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
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