1 | <?php |
||
10 | class SearchTerm implements SearchTermInterface |
||
11 | { |
||
12 | /** @var string $searchTerm */ |
||
13 | protected $searchTerm; |
||
14 | |||
15 | /** |
||
16 | * Initializes the search term |
||
17 | * |
||
18 | * @param string $searchTerm |
||
19 | */ |
||
20 | 8 | public function __construct(string $searchTerm) |
|
25 | |||
26 | /** |
||
27 | * Returns the normalized search term |
||
28 | * |
||
29 | * @return string |
||
30 | */ |
||
31 | 6 | public function __toString(): string |
|
35 | |||
36 | /** |
||
37 | * Normalizes the search term removing its spaces |
||
38 | * |
||
39 | * @param string $searchTerm |
||
40 | * @return string |
||
41 | */ |
||
42 | 8 | protected function normalize(string $searchTerm): string |
|
46 | } |
||
47 |