classTablePage
final class TablePage
One table: what reads it, what writes it, what alters it, and from where.
This is the page opened before a column is renamed or an index dropped. The writes are listed before the reads because they are the ones a schema change breaks first, and the functions issuing them are listed by themselves because the places to edit matter as much as the statements.
Constants§
public const GROUPS = ['writes' => 'Writes', 'reads' => 'Reads', 'schema' => 'Schema changes', 'other…The groups a table's statements are listed in, in order.
Methods§
public function __construct(?HtmlText $text = null, ?StatementList $list = null)Wires the page to the rendering it is written with.
Parameters
$text | ?HtmlText | |
$list | ?StatementList |
Calls 2
- new HtmlText line 41
- new StatementList line 42
public function render(ReportSite $site, string $table): stringThe body of one table's page.
Parameters
$site | ReportSite | |
$table | string |
Returns
stringTest cases 2
Called from 1
Calls 13
- method-call ReportSite::index() line 50
- new TableName line 52
- method-call TableName::isUnknown() line 55
- method-call HtmlText::escape() line 55
- method-call TableName::label() line 55
- method-call HtmlText::marked() line 55
- method-call HtmlText::count() line 56
- function-call
countline 56 - method-call TablePage::summary() line 57
- method-call TablePage::usedFrom() line 58
- method-call TablePage::alongside() line 59
- method-call StatementList::facets() line 61
- method-call TablePage::groups() line 61
public function summary(
TableName $name,
array{reads: int, writes: int, schema: int, other: int, attention: int} $usage,
): stringHow the table is used, in one sentence.
Parameters
$name | TableName | |
$usage | array{reads: int, writes: int, schema: int, other: int, attention: int} |
Returns
stringTest cases 2
Called from 1
Calls 3
- method-call HtmlText::plural() line 74
- method-call TableName::isUnknown() line 77
- function-call
implodeline 77
public function usedFrom(ReportSite $site, list<CatalogEntry> $entries): stringThe functions issuing statements on the table, most first.
Parameters
$site | ReportSite | |
$entries | list<CatalogEntry> |
Returns
stringTest cases 1
Called from 1
Calls 10
- method-call ReportSite::index() line 92
- method-call HtmlText::link() line 101
- static-call Scope::of() line 101
- method-call ReportSite::functionUrl() line 101
- method-call ReportSite::filePage() line 102
- method-call HtmlText::number() line 103
- method-call HtmlText::escape() line 104
- method-call TablePage::verbs() line 104
- method-call HtmlText::count() line 107
- function-call
countline 107
public function verbs(array{reads: int, writes: int, schema: int, other: int, attention: int} $usage): stringWhat a set of statements does to the table, as a short phrase.
Parameters
$usage | array{reads: int, writes: int, schema: int, other: int, attention: int} |
Returns
stringTest cases 1
Called from 1
Calls 1
- function-call
implodeline 126
public function alongside(ReportSite $site, string $table): stringThe tables named in the same statements, most often first.
Parameters
$site | ReportSite | |
$table | string |
Returns
stringTest cases 1
Called from 1
Calls 5
- method-call ReportSite::index() line 135
- method-call HtmlText::chipCount() line 136
- method-call TableName::label() line 136
- new TableName line 136
- method-call ReportSite::tablePage() line 136
public function groups(ReportSite $site, string $table, list<CatalogEntry> $entries): stringThe statements in the groups a schema change is reasoned about in.
Parameters
$site | ReportSite | |
$table | string | |
$entries | list<CatalogEntry> |
Returns
stringTest cases 1
Called from 1
Calls 7
- method-call ReportSite::index() line 153
- class-const TablePage::GROUPS() line 159
- method-call HtmlText::escape() line 163
- method-call HtmlText::count() line 164
- function-call
countline 164 - method-call StatementList::rows() line 165
- method-call ReportSite::tablePage() line 165
public function context(
ReportSite $site,
string $table,
): list<array{string, list<array{string, string, int|null, bool}>, string|null}>What the page is best left from: the other tables, and its own sections.
Parameters
$site | ReportSite | |
$table | string |
Returns
list<array{string, list<array{string, string, int|null, bool}>, string|null}>Test cases 2
Called from 1
Calls 7
- method-call ReportSite::index() line 179
- method-call TableName::label() line 180
- new TableName line 180
- method-call ReportSite::tablePage() line 180
- function-call
countline 180 - method-call TablePage::anchors() line 183
- class-const ReportSite::TABLES() line 187
public function anchors(CatalogIndex $index, string $table): list<array{string, string}>The sections of the page, for the navigation.
Parameters
$index | CatalogIndex | |
$table | string |
Returns
list<array{string, string}>Test cases 1
Called from 1
Calls 4
- method-call CatalogIndex::alongside() line 198
- method-call CatalogIndex::byTable() line 202
- method-call CatalogIndex::usageOf() line 203
- class-const TablePage::GROUPS() line 205
Private surface 2§
Implementation details, listed for orientation only.
private HtmlText $textprivate StatementList $listTest cases 13§
Test cases that cover or call this symbol, from the coverage report and from the analyzed test sources.
Dedicated tests 10
TablePageTest::testAlongsideIsSilentWhenTheTableIsNamedAlonecallsTablePageTest::testAnchorsFollowTheSectionsPresentcallsTablePageTest::testContextListsTheSectionsAndEveryOtherTablecallsTablePageTest::testGroupsListOnlyTheUsesPresentcallsTablePageTest::testRenderIsWrittenExactlycallsTablePageTest::testRenderSaysWhatUsesTheTableAndListsItsStatementsByWhatTheyDocallsTablePageTest::testSummaryIsSilentAboutFindingsWhenThereAreNonecallsTablePageTest::testSummaryMentionsWhatNeedsAttentioncallsTablePageTest::testUsedFromLinksEachFunctionAndSaysWhatItDoescallsTablePageTest::testVerbsNameEveryUseFoundcalls