Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
Total | |
0.00% |
0 / 4 |
|
0.00% |
0 / 1 |
CRAP | |
0.00% |
0 / 1 |
CirrusSearchHooks | |
0.00% |
0 / 4 |
|
0.00% |
0 / 1 |
2 | |
0.00% |
0 / 1 |
onCirrusSearchAddQueryFeatures | |
0.00% |
0 / 4 |
|
0.00% |
0 / 1 |
2 |
1 | <?php |
2 | |
3 | namespace GeoData; |
4 | |
5 | use CirrusSearch\Hooks\CirrusSearchAddQueryFeaturesHook; |
6 | use CirrusSearch\SearchConfig; |
7 | use GeoData\Search\CirrusNearCoordBoostFeature; |
8 | use GeoData\Search\CirrusNearCoordFilterFeature; |
9 | use GeoData\Search\CirrusNearTitleBoostFeature; |
10 | use GeoData\Search\CirrusNearTitleFilterFeature; |
11 | |
12 | /** |
13 | * Hook handlers |
14 | * All hooks from the CirrusSearch extension which is optional to use with this extension. |
15 | */ |
16 | class CirrusSearchHooks implements |
17 | CirrusSearchAddQueryFeaturesHook |
18 | { |
19 | /** |
20 | * Add geo-search feature to search syntax |
21 | * @param SearchConfig $config |
22 | * @param array &$features |
23 | */ |
24 | public function onCirrusSearchAddQueryFeatures( SearchConfig $config, array &$features ): void { |
25 | $features[] = new CirrusNearTitleBoostFeature(); |
26 | $features[] = new CirrusNearTitleFilterFeature(); |
27 | $features[] = new CirrusNearCoordBoostFeature(); |
28 | $features[] = new CirrusNearCoordFilterFeature(); |
29 | } |
30 | } |