final class PageShell
Restricted visibility: declared "@visibility root". Code outside that scope must not name this declaration.

The document every page of the report is written into.

The page is a doc-ui document: the compact layout document-design keeps for catalogs and references, with the navigation beside the reading and the tools along the top. The navigation names the routes to a statement — by table, by namespace, by file, by finding, or through the whole listing — and then whatever the page being read is best left from: the other tables beside a table, the other classes of a namespace beside a class, the places a statement belongs to beside the statement, and the sections of a long page. Each page says what that is; the shell only writes it.

Constants§

public const DESIGN_VERSION = 'v1.0.0'

The release of document-design the pages are written for, and never a later one.

public const DESIGN_STYLE = 'assets/document-design-' . self::DESIGN_VERSION . '.css'

The name the document-design stylesheet is written under.

public const DESIGN_SCRIPT = 'assets/document-design-' . self::DESIGN_VERSION . '.js'

The name the document-design script is written under.

public const DESIGN_LICENSE = 'assets/document-design-LICENSE.txt'

The name the document-design license and provenance notice is written under.

public const SCRIPT = 'assets/report.js'

The name the report's own script is written under.

public const INDEX = 'assets/search-index.js'

The name the search index is written under.

public const THEME_KEY = 'sql-catalog-theme'

The key the chosen theme is remembered under.

public const LIMIT = 40

How many entries a navigation block lists before pointing at the listing.

Methods§

public function __construct(?HtmlText $text = null)

Wires the shell to the escaping it writes through.

Parameters

$text?HtmlText
Calls 1
public function render(
    ReportSite $site,
    string $page,
    string $title,
    list<array{string, string|null}> $crumbs,
    string $body,
    list<array{string, list<array{string, string, int|null, bool}>, string|null}> $blocks = [],
): string

One complete page of the report.

Parameters

$siteReportSite
$pagestringThe name the page is written under, which fixes what its links are relative to
$titlestring
$crumbslist<array{string, string|null}>The trail to this page, as label and address pairs
$bodystring
$blockslist<array{string, list<array{string, string, int|null, bool}>, string|null}>The navigation the page is best left from: a title, its entries as label, address, count and whether it is the page being read, and where the rest of them are

Returns

string
Test cases 2
Called from 10
Calls 8
public function head(string $prefix, string $title): string

The head of a page: its title, the doc-ui stylesheet, and the theme restored before the first paint.

Parameters

$prefixstring
$titlestring

Returns

string
Test cases 1
Called from 1
Calls 4
public function topbar(list<array{string, string|null}> $crumbs, string $prefix): string

The bar along the top of a page: the way into the navigation on a phone, the trail, the search and the theme.

The search box and the theme switch are hidden until the script that drives them has run, so a page read without it shows no control that does nothing.

Parameters

$crumbslist<array{string, string|null}>
$prefixstring

Returns

string
Test cases 1
Called from 1
Calls 1
public function crumbs(list<array{string, string|null}> $crumbs, string $prefix): string

The trail shown along the top of a page.

Parameters

$crumbslist<array{string, string|null}>
$prefixstring

Returns

string
Test cases 1
Called from 1
Calls 2
public function sidebar(
    ReportSite $site,
    string $page,
    list<array{string, list<array{string, string, int|null, bool}>, string|null}> $blocks,
): string

The navigation shown beside a page: the routes, then what the page itself is best left from.

Parameters

$siteReportSite
$pagestring
$blockslist<array{string, list<array{string, string, int|null, bool}>, string|null}>

Returns

string
Test cases 1
Called from 1
Calls 3
public function routes(ReportSite $site, string $page): string

The routes a reader can take to a statement, with what each one holds.

Parameters

$siteReportSite
$pagestring

Returns

string
Test cases 1
Called from 1
Calls 16
public function block(
    string $title,
    list<array{string, string, int|null, bool}> $items,
    string|null $rest,
    string $prefix,
): string

One block of navigation: a title and the entries under it.

An address starting with # is a section of the page being read and is written as it is; any other is relative to the root of the report. A block of nothing but sections is the table of contents, and is marked so the section being read is followed as the page scrolls. A block longer than the limit is cut, and says where the rest are.

Parameters

$titlestring
$itemslist<array{string, string, int|null, bool}>
$reststring|nullWhere every entry is listed, for a block that had to be cut
$prefixstring

Returns

string
Test cases 2
Called from 1
Calls 6
public function onThisPage(list<array{string, string}> $anchors): list<array{string, list<array{string, string, int|null, bool}>, string|null}>
public function bootstrap(): string

The inline script that restores the chosen theme before the page is laid out.

The theme is kept where document-design reads it, so the switch in the topbar and this script agree on what the reader chose.

Returns

string
Test cases 2
Called from 1
Calls 1

Private surface 1§

Implementation details, listed for orientation only.

private HtmlText $text

Test cases 17§

Test cases that cover or call this symbol, from the coverage report and from the analyzed test sources.

Dedicated tests 11
Other tests reaching this symbol 6

Relations§

Instantiated in 1
Method calls 14
Constant reads 7
Type declarations 4