Conditions | 2 |
Paths | 2 |
Total Lines | 31 |
Code Lines | 16 |
Lines | 0 |
Ratio | 0 % |
Changes | 2 | ||
Bugs | 0 | Features | 0 |
1 | <?php declare(strict_types = 1); |
||
21 | public function search(?string $q): SearchResults |
||
22 | { |
||
23 | $result = new SearchResults(); |
||
24 | switch ($q) { |
||
25 | case 'Fish': |
||
26 | $records = [ |
||
27 | [ |
||
28 | 'Title' => 'Fishing in New Zealand', |
||
29 | ], |
||
30 | ]; |
||
31 | $recordsList = new ArrayList($records); |
||
32 | $result->setRecords($recordsList); |
||
33 | |||
34 | $result->setTime(0.017); |
||
35 | |||
36 | $result->setPageSize(10); |
||
37 | $result->setPage(1); |
||
38 | |||
39 | $result->setIndex('unit_test_index'); |
||
40 | $result->setSuggestions(['fush']); |
||
41 | |||
42 | |||
43 | $highlights = ['Title' => [ |
||
44 | '<b>Fish</b>ing in New Zealand', |
||
45 | ], |
||
46 | ]; |
||
47 | |||
48 | $result->Highlights = $highlights; |
||
|
|||
49 | } |
||
50 | |||
51 | return $result; |
||
52 | } |
||
61 |