classSqlToken
final class SqlToken
Restricted visibility: declared "@visibility root". Code outside that scope must not name this declaration.
One token of a SQL statement, with the nesting it was found at.
Properties§
public SqlTokenKind $kindpublic string $textpublic int $offsetpublic int $depthMethods§
public function __construct(
public SqlTokenKind $kind,
public string $text,
public int $offset,
public int $depth,
)Parameters
$kind | SqlTokenKind | What the token is |
$text | string | The token exactly as written |
$offset | int | Where the token starts in the statement |
$depth | int | How many unclosed parentheses enclose the token |
public function keyword(): stringThe token upper-cased, for comparing keywords.
Returns
stringTest cases 1
Called from 2
Calls 1
- function-call
strtoupperline 33
public function isTopLevelKeyword(string $keyword): boolWhether the token is the given keyword at the outermost nesting level.
Parameters
$keyword | string |
Returns
boolTest cases 1
Calls 2
- class-const SqlTokenKind::Word() line 41
- method-call SqlToken::keyword() line 41
Test cases 15§
Test cases that cover or call this symbol, from the coverage report and from the analyzed test sources.
Dedicated tests 2
Other tests reaching this symbol 13
CatalogCommandTestcallsEntryFactoryTestcallsExpressionEvaluatorTestcallsPlaceholderScannerTestcallsSqlLexerTest::testTokenizeSeparatesWordsAndSymbolscallsSqlLexerTest::testTokenizeTracksParenthesisDepthcallsStatementKindReaderTestcallsTableReaderTest::testIsNameRejectsKeywordsAndGapMarkerscallsTableReaderTest::testUnquoteStripsIdentifierQuotingcallsCallModelTestcallsAnalyzerTestcallsJsonReporterTestcallsTextReporterTestcalls
Relations§
Instantiated in 8
- new SqlCatalog\Core\Sql\SqlLexer::tokenize() packages/sql-catalog/src/Core/Sql/SqlLexer.php:40
- new SqlCatalog\Core\Sql\SqlLexer::readToken() packages/sql-catalog/src/Core/Sql/SqlLexer.php:60
- new SqlCatalog\Core\Sql\SqlLexer::readToken() packages/sql-catalog/src/Core/Sql/SqlLexer.php:67
- new SqlCatalog\Core\Sql\SqlLexer::readToken() packages/sql-catalog/src/Core/Sql/SqlLexer.php:71
- new SqlCatalog\Core\Sql\SqlLexer::readToken() packages/sql-catalog/src/Core/Sql/SqlLexer.php:76
- new SqlCatalog\Core\Sql\SqlLexer::readToken() packages/sql-catalog/src/Core/Sql/SqlLexer.php:80
- new SqlCatalog\Core\Sql\SqlLexer::readToken() packages/sql-catalog/src/Core/Sql/SqlLexer.php:83
- new SqlCatalog\Core\Sql\SqlLexer::readToken() packages/sql-catalog/src/Core/Sql/SqlLexer.php:86