Code Coverage |
||||||||||
Classes and Traits |
Functions and Methods |
Lines |
||||||||
Total | |
0.00% |
0 / 1 |
|
0.00% |
0 / 2 |
CRAP | |
0.00% |
0 / 4 |
RandomCrossProjectBlockScorer | |
0.00% |
0 / 1 |
|
0.00% |
0 / 2 |
6 | |
0.00% |
0 / 4 |
__construct | |
0.00% |
0 / 1 |
2 | |
0.00% |
0 / 3 |
|||
score | |
0.00% |
0 / 1 |
2 | |
0.00% |
0 / 1 |
<?php | |
namespace CirrusSearch\Search; | |
use CirrusSearch\Util; | |
/** | |
* Randomly ordered but consistent for a single user | |
*/ | |
class RandomCrossProjectBlockScorer extends CrossProjectBlockScorer { | |
public function __construct( array $settings ) { | |
parent::__construct( $settings ); | |
mt_srand( hexdec( substr( Util::generateIdentToken(), 0, 8 ) ) ); | |
} | |
/** | |
* @param string $prefix | |
* @param CirrusSearchResultSet $results | |
* @return float | |
*/ | |
public function score( $prefix, CirrusSearchResultSet $results ) { | |
return (float)mt_rand(); | |
} | |
} |