Code Coverage
 
Classes and Traits
Functions and Methods
Lines
Total
0.00% covered (danger)
0.00%
0 / 1
60.00% covered (warning)
60.00%
3 / 5
CRAP
62.50% covered (warning)
62.50%
5 / 8
CirrusDefaultSearchQueryRoute
0.00% covered (danger)
0.00%
0 / 1
60.00% covered (warning)
60.00%
3 / 5
7.90
62.50% covered (warning)
62.50%
5 / 8
 searchTextDefaultRoute
0.00% covered (danger)
0.00%
0 / 1
2.15
66.67% covered (warning)
66.67%
2 / 3
 __construct
0.00% covered (danger)
0.00%
0 / 1
2
0.00% covered (danger)
0.00%
0 / 2
 score
100.00% covered (success)
100.00%
1 / 1
1
100.00% covered (success)
100.00%
1 / 1
 getSearchEngineEntryPoint
100.00% covered (success)
100.00%
1 / 1
1
100.00% covered (success)
100.00%
1 / 1
 getProfileContext
100.00% covered (success)
100.00%
1 / 1
1
100.00% covered (success)
100.00%
1 / 1
<?php
namespace CirrusSearch\Dispatch;
/**
 * Cirrus default routes
 */
class CirrusDefaultSearchQueryRoute implements SearchQueryRoute {
    private static $SEARCH_TEXT;
    public static function searchTextDefaultRoute(): SearchQueryRoute {
        if ( self::$SEARCH_TEXT === null ) {
            self::$SEARCH_TEXT = new self( 'searchText' );
        }
        return self::$SEARCH_TEXT;
    }
    /** @var string */
    private $searchEngineEntryPoint;
    /**
     * @param string $searchEngineEntryPoint
     */
    private function __construct( $searchEngineEntryPoint ) {
        $this->searchEngineEntryPoint = $searchEngineEntryPoint;
    }
    /**
     * @param \CirrusSearch\Search\SearchQuery $query
     * @return float
     */
    public function score( \CirrusSearch\Search\SearchQuery $query ) {
        return SearchQueryDispatchService::CIRRUS_DEFAULTS_SCORE;
    }
    /**
     * @return string
     */
    public function getSearchEngineEntryPoint() {
        return $this->searchEngineEntryPoint;
    }
    /**
     * @return string
     */
    public function getProfileContext() {
        return \CirrusSearch\Profile\SearchProfileService::CONTEXT_DEFAULT;
    }
}