Code Coverage
 
Lines
Functions and Methods
Classes and Traits
Total
0.00% covered (danger)
0.00%
0 / 4
0.00% covered (danger)
0.00%
0 / 1
CRAP
0.00% covered (danger)
0.00%
0 / 1
CirrusSearchHooks
0.00% covered (danger)
0.00%
0 / 4
0.00% covered (danger)
0.00%
0 / 1
2
0.00% covered (danger)
0.00%
0 / 1
 onCirrusSearchAddQueryFeatures
0.00% covered (danger)
0.00%
0 / 4
0.00% covered (danger)
0.00%
0 / 1
2
1<?php
2
3namespace GeoData;
4
5use CirrusSearch\Hooks\CirrusSearchAddQueryFeaturesHook;
6use CirrusSearch\SearchConfig;
7use GeoData\Search\CirrusNearCoordBoostFeature;
8use GeoData\Search\CirrusNearCoordFilterFeature;
9use GeoData\Search\CirrusNearTitleBoostFeature;
10use GeoData\Search\CirrusNearTitleFilterFeature;
11
12/**
13 * Hook handlers
14 * All hooks from the CirrusSearch extension which is optional to use with this extension.
15 */
16class 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}