Merge "Declare dynamic properties"
[lhc/web/wiklou.git] / includes / search / SearchNearMatchResultSet.php
1 <?php
2 /**
3 * A ISearchResultSet wrapper for SearchNearMatcher
4 */
5 class SearchNearMatchResultSet extends SearchResultSet {
6 /**
7 * @param Title|null $match Title if matched, else null
8 */
9 public function __construct( $match ) {
10 if ( $match === null ) {
11 $this->results = [];
12 } else {
13 $this->results = [ SearchResult::newFromTitle( $match, $this ) ];
14 }
15 }
16
17 public function numRows() {
18 return $this->results ? 1 : 0;
19 }
20 }