/**
* Move the suggestion at index $key to the first position
+ * @param string $key
*/
public function rescore( $key ) {
$removed = array_splice( $this->suggestions, $key, 1 );
*/
public static function fromTitles( array $titles ) {
$score = count( $titles );
- $suggestions = array_map( function( $title ) use ( &$score ) {
+ $suggestions = array_map( function ( $title ) use ( &$score ) {
return SearchSuggestion::fromTitle( $score--, $title );
}, $titles );
return new SearchSuggestionSet( $suggestions );
*/
public static function fromStrings( array $titles ) {
$score = count( $titles );
- $suggestions = array_map( function( $title ) use ( &$score ) {
+ $suggestions = array_map( function ( $title ) use ( &$score ) {
return SearchSuggestion::fromText( $score--, $title );
}, $titles );
return new SearchSuggestionSet( $suggestions );