classStatementPage
final class StatementPage
One statement, with everything the analysis established about it.
The statement comes first and largest, laid out a clause per line, because it is what the reader came for. Around it are the facts that decide what to do about it: where it is issued and through what, what it names, what is bound to it, and what the analyzer could not settle. The other statements of the same function and on the same table are listed last, so the reading can continue without going back.
Constants§
public const RELATED = 8How many related statements are listed before pointing at their own page.
public const LABEL = 40How much of a statement the navigation beside the page shows of it.
Methods§
public function __construct(
?HtmlText $text = null,
?SqlHighlighter $sql = null,
?SqlFormatter $formatter = null,
?StatementList $list = null,
?Palette $palette = null,
)Wires the page to the rendering it is written with.
Parameters
$text | ?HtmlText | |
$sql | ?SqlHighlighter | |
$formatter | ?SqlFormatter | |
$list | ?StatementList | |
$palette | ?Palette |
Calls 5
- new HtmlText line 64
- new SqlHighlighter line 65
- new SqlFormatter line 66
- new StatementList line 67
- new Palette line 68
public function render(ReportSite $site, CatalogEntry $entry): stringThe body of one statement's page.
Parameters
$site | ReportSite | |
$entry | CatalogEntry |
Returns
stringTest cases 5
StatementPageTest::testRenderCarriesEverythingKnownAboutTheStatementcallsStatementPageTest::testRenderIsWrittenExactlycallsStatementPageTest::testRenderLeavesOutTheValuesWhenTheStatementTakesNonecallsStatementPageTest::testRenderOfACallNothingWasReadFromIsWrittenExactlycallsStatementPageTest::testRenderShowsUnanalyzedSourceBetweenTheCaveatAndStatementFactscalls
Called from 1
Calls 15
- method-call ReportSite::statementPage() line 76
- method-call HtmlText::chip() line 78
- function-call
strtoupperline 78 - method-call Palette::kind() line 78
- method-call HtmlText::escape() line 79
- method-call StatementPage::title() line 79
- method-call StatementPage::where() line 80
- method-call StatementPage::body() line 81
- method-call StatementPage::caveats() line 82
- method-call SourceCode::excerpt() line 83
- new SourceCode line 83
- method-call StatementPage::facts() line 85
- method-call StatementPage::values() line 86
- method-call StatementPage::findings() line 87
- method-call StatementPage::related() line 88
public function title(CatalogEntry $entry): stringWhat the statement is, in a few words.
Parameters
$entry | CatalogEntry |
Returns
stringTest cases 1
Called from 1
Calls 5
- method-call CatalogEntry::resolution() line 96
- class-const Resolution::NotAnalyzed() line 96
- method-call TableName::label() line 104
- new TableName line 104
- function-call
implodeline 107
public function where(ReportSite $site, CatalogEntry $entry): stringWhere the statement is issued, as a sentence whose every place is a link.
Parameters
$site | ReportSite | |
$entry | CatalogEntry |
Returns
stringTest cases 2
Called from 1
Calls 8
- static-call Scope::of() line 115
- method-call HtmlText::link() line 116
- method-call ReportSite::filePage() line 116
- method-call ReportSite::functionUrl() line 118
- method-call HtmlText::chip() line 120
- function-call
countline 121 - method-call HtmlText::escape() line 122
- function-call
implodeline 122
public function body(CatalogEntry $entry, ?SqlFormatter $formatter = null): stringThe statement itself, laid out for reading, or the call it was not read from.
The copy button takes what the block shows, so what is copied is what was read: expanded SQL, with named gaps where PHP variables are known.
Parameters
$entry | CatalogEntry | |
$formatter | ?SqlFormatter |
Returns
stringTest cases 3
Called from 1
Calls 6
- method-call CatalogEntry::resolution() line 136
- class-const Resolution::NotAnalyzed() line 136
- method-call CatalogEntry::firstGap() line 137
- method-call HtmlText::escape() line 140
- method-call SqlHighlighter::render() line 145
- method-call CatalogEntry::parts() line 145
public function caveats(CatalogEntry $entry): stringWhat a reader has to know before trusting the statement.
Parameters
$entry | CatalogEntry |
Returns
stringTest cases 1
Called from 1
Calls 3
- method-call CatalogEntry::resolution() line 156
- class-const Resolution::NotAnalyzed() line 156
- method-call HtmlText::escape() line 171
public function facts(ReportSite $site, CatalogEntry $entry): stringThe facts about the reading, as a list of labelled values.
Parameters
$site | ReportSite | |
$entry | CatalogEntry |
Returns
stringTest cases 1
Called from 2
Calls 11
- method-call CatalogEntry::resolution() line 182
- method-call HtmlText::chipLink() line 185
- method-call TableName::label() line 185
- new TableName line 185
- method-call ReportSite::tablePage() line 185
- method-call HtmlText::chip() line 188
- method-call Palette::resolution() line 188
- method-call HtmlText::escape() line 188
- method-call CatalogEntry::searchClosed() line 189
- function-call
strtoupperline 194 - method-call Palette::kind() line 194
public function values(CatalogEntry $entry): stringThe bind parameters of the statement, with what each is bound to.
Parameters
$entry | CatalogEntry |
Returns
stringTest cases 1
Called from 1
Calls 1
- method-call StatementPage::valueRow() line 215
public function valueRow(Placeholder $placeholder): stringOne bind parameter as a row.
Parameters
$placeholder | Placeholder |
Returns
stringTest cases 1
Called from 1
Calls 2
- method-call HtmlText::escape() line 232
- method-call StatementPage::openValue() line 233
public function openValue(list<string> $origins): stringHow a value that did not resolve to a set of alternatives is described.
Parameters
$origins | list<string> |
Returns
stringCalled from 1
Calls 1
- function-call
implodeline 247
public function findings(CatalogEntry $entry): stringWhat is worth reporting about the statement.
Parameters
$entry | CatalogEntry |
Returns
stringTest cases 1
Called from 1
Calls 3
- method-call HtmlText::chip() line 260
- method-call Palette::severity() line 260
- method-call HtmlText::escape() line 261
public function context(
ReportSite $site,
CatalogEntry $entry,
): list<array{string, list<array{string, string, int|null, bool}>, string|null}>What the page is best left from: the places the statement belongs to, and the rest of its function.
Parameters
$site | ReportSite | |
$entry | CatalogEntry |
Returns
list<array{string, list<array{string, string, int|null, bool}>, string|null}>Test cases 3
Called from 1
Calls 14
- method-call ReportSite::index() line 274
- static-call Scope::of() line 275
- method-call ReportSite::catalog() line 277
- method-call TableName::label() line 281
- new TableName line 281
- method-call ReportSite::tablePage() line 281
- function-call
countline 281 - method-call ReportSite::classPage() line 284
- method-call ReportSite::functionUrl() line 287
- method-call ReportSite::filePage() line 289
- method-call HtmlText::truncate() line 292
- method-call SqlHighlighter::plain() line 292
- class-const StatementPage::LABEL() line 292
- method-call ReportSite::statementPage() line 292
Private surface 5§
Implementation details, listed for orientation only.
private HtmlText $textprivate SqlHighlighter $sqlprivate SqlFormatter $formatterprivate StatementList $listprivate Palette $paletteTest cases 23§
Test cases that cover or call this symbol, from the coverage report and from the analyzed test sources.
Dedicated tests 21
StatementPageTest::testBodyDoesNotDressUpACallNoStatementWasReadFromcallsStatementPageTest::testBodyLaysTheStatementOutAndKeepsTheSourceFormcallsStatementPageTest::testBodyUsesTheSameNamedGapInTheCopyableAndSourceBlockscallsStatementPageTest::testCaveatsWarnAboutWhatTheStatementDoesNotSaycallsStatementPageTest::testContextLeadsToEveryPlaceTheStatementBelongsToAndTheRestOfItsFunctioncallsStatementPageTest::testContextOfTopLevelCodeLeadsOnlyToItsFilecallsStatementPageTest::testFactsLinkTheTablesAndExplainTheReadingcallsStatementPageTest::testFindingsCarryTheirRuleAndSeveritycallsStatementPageTest::testOpenValueSaysSoWhenNothingIsKnownAboutWhereItCameFromcallsStatementPageTest::testRelatedListsTheFirstOfTheRestAndOnlyTheFirstTwoTablescallsStatementPageTest::testRelatedPointsAtTheRestWhenThereIsMoreThanItListscallsStatementPageTest::testRenderCarriesEverythingKnownAboutTheStatementcallsStatementPageTest::testRenderIsWrittenExactlycallsStatementPageTest::testRenderLeavesOutTheValuesWhenTheStatementTakesNonecallsStatementPageTest::testRenderOfACallNothingWasReadFromIsWrittenExactlycallsStatementPageTest::testRenderShowsUnanalyzedSourceBetweenTheCaveatAndStatementFactscallsStatementPageTest::testTitleNamesTheTablesOrSaysWhyThereAreNonecallsStatementPageTest::testValueRowSaysWhenNothingWasBoundOrPinnedDowncallsStatementPageTest::testValuesListTheBindParameterscallsStatementPageTest::testWhereLinksEveryPlaceAndNamesThePathTakencallsStatementPageTest::testWhereSaysNothingAboutThePathWhenTheStatementIsReadWhereItIsWrittencalls
Other tests reaching this symbol 2
ReporterInterfaceTestcallsHtmlReporterTestcalls