classHtmlReporter
final class HtmlReporter
implements ReporterInterface
Writes the catalog as a site of linked HTML pages.
A reader comes to a catalog to find a statement and decide something about it, so the site is laid out as the routes to one: by the table it names, by the namespace and class that issue it, by the file it is written in, by what the analysis reported on it, or through the whole listing narrowed down. Every statement has a page of its own, which is where every route ends.
Constants§
public const FILE = ReportSite::INDEXThe name the page a reader opens first is written under.
Methods§
public function __construct(private SqlFormatter $formatter = new \SqlCatalog\Reporter\Html\SqlFormatter())Supplies SQL presentation independently of page rendering.
Parameters
$formatter | SqlFormatter |
Calls 1
- new SqlFormatter line 39
public function name(): stringThe name the command line selects this reporter by.
Returns
stringTest cases 1
public function description(): stringWhat the reporter produces.
Returns
stringTest cases 1
public function render(Catalog $catalog): CatalogArtifactsThe catalog rendered as a site of pages.
Parameters
$catalog | Catalog |
Returns
Test cases 7
HtmlReporterTest::testRenderCarriesTheFilesThatCouldNotBeReadcallsHtmlReporterTest::testRenderIncludesSourceForUnresolvedAndUnanalyzedCallsAndParseFailurescallsHtmlReporterTest::testRenderKeepsACallNoStatementWasReadFromApartFromAStatementcallsHtmlReporterTest::testRenderLinksEveryRouteToTheStatementsPagecallsHtmlReporterTest::testRenderNamesThePageAReaderOpensFirstcallsHtmlReporterTest::testRenderWritesTheTrailToEveryPagecallsHtmlReporterTest::testRenderWritesTheWholeSiteOfPagescalls
Calls 36
- new ReportSite line 72
- new PageShell line 73
- class-const ReportSite::INDEX() line 74
- method-call ReportAssets::all() line 76
- new ReportAssets line 76
- class-const PageShell::INDEX() line 77
- method-call SearchIndex::render() line 77
- new SearchIndex line 77
- method-call PageShell::render() line 78
- method-call OverviewPage::render() line 78
- new OverviewPage line 78
- method-call PageShell::onThisPage() line 78
- class-const ReportSite::STATEMENTS() line 82
- method-call StatementIndexPage::render() line 82
- new StatementIndexPage line 82
- class-const ReportSite::TABLES() line 83
- method-call TableIndexPage::render() line 83
- new TableIndexPage line 83
- new NamespacePage line 84
- class-const ReportSite::NAMESPACES() line 85
- method-call NamespacePage::render() line 85
- method-call NamespacePage::anchors() line 85
- new FileIndexPage line 86
- class-const ReportSite::FILES() line 87
- method-call FileIndexPage::render() line 87
- method-call FileIndexPage::anchors() line 87
- new FindingPage line 88
- class-const ReportSite::FINDINGS() line 89
- method-call FindingPage::render() line 89
- method-call FindingPage::anchors() line 89
- new CatalogArtifacts line 91
- function-call
array_mergeline 92 - method-call HtmlReporter::tablePages() line 92
- method-call HtmlReporter::classPages() line 92
- method-call HtmlReporter::filePages() line 92
- method-call HtmlReporter::statementPages() line 92
public function tablePages(ReportSite $site, PageShell $shell): array<string, string>One page per table the catalog names.
Parameters
$site | ReportSite | |
$shell | PageShell |
Returns
array<string, string>Test cases 1
Called from 1
Calls 10
- new TablePage line 104
- method-call ReportSite::tables() line 106
- method-call ReportSite::tablePage() line 107
- method-call TableName::label() line 108
- new TableName line 108
- method-call PageShell::render() line 109
- class-const ReportSite::INDEX() line 113
- class-const ReportSite::TABLES() line 113
- method-call TablePage::render() line 114
- method-call TablePage::context() line 115
public function classPages(ReportSite $site, PageShell $shell): array<string, string>One page per class that issues a statement.
Parameters
$site | ReportSite | |
$shell | PageShell |
Returns
array<string, string>Test cases 1
Called from 1
Calls 9
- new ClassPage line 129
- method-call ReportSite::classes() line 131
- method-call ReportSite::classPage() line 132
- method-call PageShell::render() line 133
- class-const ReportSite::INDEX() line 137
- class-const ReportSite::NAMESPACES() line 137
- static-call Scope::of() line 137
- method-call ClassPage::render() line 138
- method-call ClassPage::context() line 139
public function filePages(ReportSite $site, PageShell $shell): array<string, string>One page per file a statement is written in.
Parameters
$site | ReportSite | |
$shell | PageShell |
Returns
array<string, string>Test cases 1
Called from 1
Calls 8
- new FilePage line 153
- method-call ReportSite::files() line 155
- method-call ReportSite::filePage() line 156
- method-call PageShell::render() line 157
- class-const ReportSite::INDEX() line 161
- class-const ReportSite::FILES() line 161
- method-call FilePage::render() line 162
- method-call FilePage::context() line 163
public function statementPages(ReportSite $site, PageShell $shell): array<string, string>One page per statement.
Parameters
$site | ReportSite | |
$shell | PageShell |
Returns
array<string, string>Test cases 1
Called from 1
Calls 9
- new StatementPage line 177
- method-call ReportSite::index() line 179
- method-call ReportSite::statementPage() line 180
- method-call PageShell::render() line 181
- function-call
strtoupperline 184 - class-const ReportSite::INDEX() line 185
- class-const ReportSite::STATEMENTS() line 185
- method-call StatementPage::render() line 186
- method-call StatementPage::context() line 187
Private surface 1§
Implementation details, listed for orientation only.
private SqlFormatter $formatter = new \SqlCatalog\Reporter\Html\SqlFormatter()Test cases 19§
Test cases that cover or call this symbol, from the coverage report and from the analyzed test sources.
Dedicated tests 13
HtmlReporterTest::testClassPagesWriteOneDocumentPerClasscallsHtmlReporterTest::testDescriptionMentionsWhatItProducescallsHtmlReporterTest::testFilePagesWriteOneDocumentPerFilecallsHtmlReporterTest::testNameIsHowTheCommandLineSelectsItcallsHtmlReporterTest::testRenderCarriesTheFilesThatCouldNotBeReadcallsHtmlReporterTest::testRenderIncludesSourceForUnresolvedAndUnanalyzedCallsAndParseFailurescallsHtmlReporterTest::testRenderKeepsACallNoStatementWasReadFromApartFromAStatementcallsHtmlReporterTest::testRenderLinksEveryRouteToTheStatementsPagecallsHtmlReporterTest::testRenderNamesThePageAReaderOpensFirstcallsHtmlReporterTest::testRenderWritesTheTrailToEveryPagecallsHtmlReporterTest::testRenderWritesTheWholeSiteOfPagescallsHtmlReporterTest::testStatementPagesWriteOneDocumentPerStatementcallsHtmlReporterTest::testTablePagesWriteOneDocumentPerTablecalls