Page MenuHomeWickedGov Phorge

SpecialSearchTestMockResultSet.php
No OneTemporary

Size
1 KB
Referenced Files
None
Subscribers
None

SpecialSearchTestMockResultSet.php

<?php
use MediaWiki\Title\Title;
class SpecialSearchTestMockResultSet extends SearchResultSet {
private ?string $suggestion;
private ?string $rewrittenQuery;
public function __construct(
?string $suggestion = null,
?string $rewrittenQuery = null,
array $results = [],
bool $containedSyntax = false
) {
$this->suggestion = $suggestion;
$this->rewrittenQuery = $rewrittenQuery;
$this->results = $results;
$this->containedSyntax = $containedSyntax;
}
public function getTotalHits() {
return $this->numRows();
}
public function hasSuggestion() {
return $this->suggestion !== null;
}
public function getSuggestionQuery() {
return $this->suggestion;
}
public function getSuggestionSnippet() {
return $this->suggestion;
}
public function hasRewrittenQuery() {
return $this->rewrittenQuery !== null;
}
public function getQueryAfterRewrite() {
return $this->rewrittenQuery;
}
public function getQueryAfterRewriteSnippet() {
return htmlspecialchars( $this->rewrittenQuery );
}
public function getFirstResult(): ?Title {
$first = reset( $this->results );
return $first ? $first->getTitle() : null;
}
}

File Metadata

Mime Type
text/x-php
Expires
Sat, Oct 3, 23:11 (1 w, 6 d ago)
Storage Engine
local-disk
Storage Format
Raw Data
Storage Handle
1d/80/18a5e59e7c3334b64efcd50c76d8
Default Alt Text
SpecialSearchTestMockResultSet.php (1 KB)

Event Timeline