classPlaceholderScanner
final class PlaceholderScanner
Restricted visibility: declared "@visibility root". Code outside that scope must not name this declaration.
Finds the bind parameters of a statement, including one still holding gaps.
Constants§
public const HOLE_MARKER = 'sql_catalog_gap'The stand-in gaps are rendered as, chosen to lex as one ordinary word.
Methods§
public function __construct(?SqlLexer $lexer = null)public function scan(TextPattern $pattern): list<PlaceholderRef>The bind parameters of a statement, in the order they are written.
Parameters
$pattern | TextPattern |
Returns
list<PlaceholderRef>Test cases 5
PlaceholderScannerTest::testScanFindsNamedParameterscallsPlaceholderScannerTest::testScanFindsPositionalParametersInOrdercallsPlaceholderScannerTest::testScanIgnoresPostgresCastscallsPlaceholderScannerTest::testScanIgnoresQuestionMarksInsideStringscallsPlaceholderScannerTest::testScanReadsThroughAGapWithoutBreakingTheStringAroundItcalls
Called from 1
Calls 6
- method-call SqlLexer::tokenize() line 40
- method-call TextPattern::render() line 40
- class-const PlaceholderScanner::HOLE_MARKER() line 40
- class-const SqlTokenKind::Parameter() line 41
- new PlaceholderRef line 44
- method-call PlaceholderScanner::nameOf() line 44
public function nameOf(string $token): ?stringThe name a parameter binds by, or null when it binds by position.
Parameters
$token | string |
Returns
?stringTest cases 1
Called from 1
Private surface 1§
Implementation details, listed for orientation only.
private SqlLexer $lexerTest cases 15§
Test cases that cover or call this symbol, from the coverage report and from the analyzed test sources.
Dedicated tests 6
PlaceholderScannerTest::testNameOfReadsEveryParameterSyntaxcallsPlaceholderScannerTest::testScanFindsNamedParameterscallsPlaceholderScannerTest::testScanFindsPositionalParametersInOrdercallsPlaceholderScannerTest::testScanIgnoresPostgresCastscallsPlaceholderScannerTest::testScanIgnoresQuestionMarksInsideStringscallsPlaceholderScannerTest::testScanReadsThroughAGapWithoutBreakingTheStringAroundItcalls
Other tests reaching this symbol 9
CatalogCommandTestcallsEntryFactoryTestcallsExpressionEvaluatorTestcallsStatementKindReaderTestcallsTableReaderTest::testIsNameRejectsKeywordsAndGapMarkerscallsCallModelTestcallsAnalyzerTestcallsJsonReporterTestcallsTextReporterTestcalls
Relations§
Instantiated in 1
Method calls 1
Constant reads 5
- class-const SqlCatalog\Core\Sql\StatementKindReader::read() packages/sql-catalog/src/Core/Sql/StatementKindReader.php:68
- class-const SqlCatalog\Core\Sql\TableReader::read() packages/sql-catalog/src/Core/Sql/TableReader.php:57
- class-const SqlCatalog\Core\Sql\TableReader::read() packages/sql-catalog/src/Core/Sql/TableReader.php:65
- class-const SqlCatalog\Core\Sql\TableReader::isName() packages/sql-catalog/src/Core/Sql/TableReader.php:114
- class-const SqlCatalog\Core\Sql\TableReader::isName() packages/sql-catalog/src/Core/Sql/TableReader.php:118