| 1 | <?php |
||
| 10 | class SearchResult extends ParameterArrayConstructor |
||
| 11 | { |
||
| 12 | /** |
||
| 13 | * URL of the search result |
||
| 14 | * @var string |
||
| 15 | */ |
||
| 16 | protected $url; |
||
| 17 | |||
| 18 | /** |
||
| 19 | * Description of result's relevance |
||
| 20 | * @var Relevance |
||
| 21 | */ |
||
| 22 | protected $relevance; |
||
| 23 | |||
| 24 | /** |
||
| 25 | * Human-readable title |
||
| 26 | * @var string |
||
| 27 | */ |
||
| 28 | protected $title; |
||
| 29 | |||
| 30 | /** |
||
| 31 | * Human-readable description |
||
| 32 | * |
||
| 33 | * Ideally 20-100 words, may be HTML-formatted (although links should be |
||
| 34 | * stripped out). |
||
| 35 | * @var string |
||
| 36 | */ |
||
| 37 | protected $description; |
||
| 38 | |||
| 39 | /** |
||
| 40 | * Simplified description of search domain source of the result |
||
| 41 | * @var SearchSource |
||
| 42 | */ |
||
| 43 | protected $source; |
||
| 44 | |||
| 45 | /** |
||
| 46 | * Construct a SearchResult |
||
| 47 | * |
||
| 48 | * Expects an associative parameter array: |
||
| 49 | * |
||
| 50 | * ``` |
||
| 51 | * [ |
||
| 52 | * 'url' => URL of the search result as a string, |
||
| 53 | * 'title' => Title of the search result as a string, |
||
| 54 | * 'relevance' => instance of `Relevance`, |
||
| 55 | * 'source' => instance of `SearchSource`, |
||
| 56 | * 'description' => Optional: search result descriptin as a string |
||
| 57 | * ] |
||
| 58 | * ``` |
||
| 59 | * |
||
| 60 | * @param mixed[string] $params |
||
|
1 ignored issue
–
show
|
|||
| 61 | */ |
||
| 62 | public function __construct($params) |
||
| 77 | |||
| 78 | /** |
||
| 79 | * Sort into order of descending relevance |
||
| 80 | * |
||
| 81 | * @param SearchResult[] $results |
||
| 82 | * @return void |
||
| 83 | */ |
||
| 84 | public static function sort(&$results) |
||
| 96 | } |
||
| 97 |
This check marks PHPDoc comments that could not be parsed by our parser. To see which comment annotations we can parse, please refer to our documentation on supported doc-types.