classSearchIndex
final class SearchIndex
The index the search box reads, written as a script beside the pages.
Splitting a catalog across pages is what makes it readable and what makes a statement hard to find, so the split comes with an index of every statement and the page it is on. The index is a script rather than data fetched at runtime, so the report still works opened from a file. The report's own script ranks it and hands each hit to doc-ui's search box to show.
Constants§
public const LENGTH = 240How much of a statement the index carries.
Methods§
public function __construct(?HtmlText $text = null)public function render(ReportSite $site): stringThe index as the script the pages load.
Parameters
$site | ReportSite |
Returns
stringTest cases 1
Called from 1
Calls 3
- method-call ReportSite::index() line 43
- method-call SearchIndex::entryToArray() line 44
- function-call
json_encodeline 46
public function entryToArray(
ReportSite $site,
CatalogEntry $entry,
): array{q: string, w: string, f: string, t: string, u: string, k: string, r: string}One statement as the search reads it: the text, where it is issued, what it names, and where it is written up.
Parameters
$site | ReportSite | |
$entry | CatalogEntry |
Returns
array{q: string, w: string, f: string, t: string, u: string, k: string, r: string}Test cases 2
Called from 1
Calls 9
- method-call HtmlText::truncate() line 59
- method-call SqlHighlighter::plain() line 59
- new SqlHighlighter line 59
- method-call CatalogEntry::parts() line 59
- class-const SearchIndex::LENGTH() line 59
- function-call
implodeline 62 - method-call ReportSite::statementPage() line 63
- function-call
strtoupperline 64 - method-call CatalogEntry::resolution() line 65
Private surface 1§
Implementation details, listed for orientation only.
private HtmlText $textTest cases 5§
Test cases that cover or call this symbol, from the coverage report and from the analyzed test sources.
Dedicated tests 3
Other tests reaching this symbol 2
ReporterInterfaceTestcallsHtmlReporterTestcalls