classStatementPart
final class StatementPart
Restricted visibility: declared "@visibility root". Code outside that scope must not name this declaration.
One piece of a catalogued statement: a run of text that is known, or a gap.
A statement the analyzer could not pin down is not a string with a marker in it. It is a shape, and the gaps in that shape are claims about the analysis: this much is the statement, and this much is a value that would be spliced into it. Reporting the two apart is what lets a reader see which is which instead of reading {$} as something the program writes.
Properties§
public string $textpublic bool $isGap = falsepublic string $origin = ''public string $reason = ''public string|null $expression = nullpublic string|null $variable = nullMethods§
public function __construct(
public string $text,
public bool $isGap = false,
public string $origin = '',
public string $reason = '',
public string|null $expression = null,
public string|null $variable = null,
)Parameters
$text | string | The characters of a known run, empty for a gap |
$isGap | bool | Whether this is a gap rather than a run of known text |
$origin | string | Where the value filling a gap comes from, empty for a known run |
$reason | string | What fills the gap, written for a reader, empty for a known run |
$expression | string|null | The source expression of a gap, when it is short enough to quote |
$variable | string|null | The PHP variable read at the use site, when known |
public static function of(TextPattern $pattern): list<self>The parts a reconstructed statement is known in, in order.
Parameters
$pattern | TextPattern |
Returns
list<self>Test cases 7
StatementPartTest::testOfHasNothingToSayAboutAnEmptyStatementcallsStatementPartTest::testOfKeepsAKnownRunAsTheTextItIscallsStatementPartTest::testOfKeepsTheRunsAndTheGapsInOrdercallsStatementPartTest::testOfKeepsWhatIsKnownAboutAGapcallsSqlHighlighterTest::testInlineWritesTheStatementOnOneLinecallsSqlHighlighterTest::testRenderMarksTheResolvedRunsAndTheGapsBetweenThemcallsSqlHighlighterTest::testRenderSaysSoWhenThereIsNothingToShowcalls
Called from 1
Calls 1
- new
selfline 52
Test cases 36§
Test cases that cover or call this symbol, from the coverage report and from the analyzed test sources.
Dedicated tests 4
Other tests reaching this symbol 32
CatalogEntryTest::testPartsAreTheRunsAndGapsTheStatementIsKnownIncallsSqlFormatterTest::testFormatUsesAnApplicationPolicyAndTriesTheNextOnDeclinecallsAnalyzerTestcallsBuiltinsTest::testSqlFormatterKeepsTheDefaultExpandedPresentationcallsHtmlReporterTestcallsClassPageTestcallsFileIndexPageTestcallsFilePageTestcallsFindingPageTestcallsNamespacePageTestcallsOverviewPageTestcallsStatementIndexPageTestcallsStatementPageTestcallsTableIndexPageTestcallsTablePageTestcallsPageShellTestcallsSearchIndexTestcallsSqlFormatterTest::testFormatExpandsSqlAcrossSupportedDialectscallsSqlFormatterTest::testFormatLeavesUnsupportedAndUnknownStatementsIntactcallsSqlFormatterTest::testFormatPreservesGapIdentityAndMetadatacallsSqlFormatterTest::testFormatPreservesLiteralWhitespaceAndLineCommentBoundariescallsSqlFormatterTest::testMaskParametersPreservesClientPlaceholdersAndPostgresCastscallsSqlFormatterTest::testMaskPreservesLiteralMarkersAndRestoresGapsWithoutCollisionscallsSqlFormatterTest::testRestoreRejectsLostGapscallsSqlHighlighterTest::testHoleLabelUsesOnlyAnIdentifiedVariableNamecallsSqlHighlighterTest::testHoleSaysWhereTheValueThatFillsItComesFromcallsSqlHighlighterTest::testInlineWritesTheStatementOnOneLinecallsSqlHighlighterTest::testPlainUsesNamedGapsWithoutEscapingKnownTextcallsSqlHighlighterTest::testRenderMarksTheResolvedRunsAndTheGapsBetweenThemcallsSqlHighlighterTest::testRenderSaysSoWhenThereIsNothingToShowcallsStatementListTestcallsStatementRowTestcalls
Relations§
Instantiated in 4
- new SqlCatalog\Reporter\Html\SqlFormatter::maskParameters() packages/sql-catalog/src/Reporter/Html/SqlFormatter.php:100
- new SqlCatalog\Reporter\Html\SqlFormatter::restore() packages/sql-catalog/src/Reporter/Html/SqlFormatter.php:123
- new SqlCatalog\Reporter\Html\SqlFormatter::restore() packages/sql-catalog/src/Reporter/Html/SqlFormatter.php:131
- new SqlCatalog\Reporter\Html\SqlHighlighter::inline() packages/sql-catalog/src/Reporter/Html/SqlHighlighter.php:82
Static calls 1
Type declarations 6
- type SqlCatalog\Core\Catalog\CatalogEntry packages/sql-catalog/src/Core/Catalog/CatalogEntry.php:88
- type SqlCatalog\Reporter\Html\SqlFormatter::format() packages/sql-catalog/src/Reporter/Html/SqlFormatter.php:37
- type SqlCatalog\Reporter\Html\SqlFormatter::mask() packages/sql-catalog/src/Reporter/Html/SqlFormatter.php:62
- type SqlCatalog\Reporter\Html\SqlHighlighter::plain() packages/sql-catalog/src/Reporter/Html/SqlHighlighter.php:70
- type SqlCatalog\Reporter\Html\SqlHighlighter packages/sql-catalog/src/Reporter/Html/SqlHighlighter.php:161
- type SqlCatalog\Reporter\Html\SqlHighlighter packages/sql-catalog/src/Reporter/Html/SqlHighlighter.php:175