classLiteralMasker
final class LiteralMasker
Restricted visibility: declared "@visibility ZtdQuery\Platform\Sqlite". Code outside that scope must not name this declaration.
Masks comments and string literals while preserving their byte offsets.
Methods§
public function stripComments(string $sql): stringStrip SQL comments from a string.
Parameters
$sql | string |
Returns
stringTest cases 11
LiteralMaskerTest::testStripCommentsPreservesContentcallsLiteralMaskerTest::testStripCommentsPreservesQuotedCommentMarkerscallsLiteralMaskerTest::testStripCommentsRemovesBlockCommentcallsLiteralMaskerTest::testStripCommentsRemovesHashCommentcallsLiteralMaskerTest::testStripCommentsRemovesLineCommentcallsLiteralMaskerTest::testStripCommentsStripBlockCommentcallsLiteralMaskerTest::testStripCommentsStripBlockCommentPreservesLexicalBoundaryWithoutSurroundingSpacescallsLiteralMaskerTest::testStripCommentsStripHashCommentcallsLiteralMaskerTest::testStripCommentsStripLineCommentcallsLiteralMaskerTest::testStripCommentsStripMultipleCommentscallsLiteralMaskerTest::testStripCommentsTrimsOuterWhitespacecalls
Called from 13
- method-call ZtdQuery\Platform\Sqlite\Sql\Dml\Insert\InsertClauseParser::extractInsertColumns() packages/ztd-query-sqlite/src/Sql/Dml/Insert/InsertClauseParser.php:21
- method-call ZtdQuery\Platform\Sqlite\Sql\Dml\Insert\InsertClauseParser::extractInsertValues() packages/ztd-query-sqlite/src/Sql/Dml/Insert/InsertClauseParser.php:36
- method-call ZtdQuery\Platform\Sqlite\Sql\Dml\Insert\InsertClauseParser::hasOnConflict() packages/ztd-query-sqlite/src/Sql/Dml/Insert/InsertClauseParser.php:55
- method-call ZtdQuery\Platform\Sqlite\Sql\Dml\Insert\InsertClauseParser::isReplace() packages/ztd-query-sqlite/src/Sql/Dml/Insert/InsertClauseParser.php:64
- method-call ZtdQuery\Platform\Sqlite\Sql\Dml\Insert\InsertClauseParser::isInsertIgnore() packages/ztd-query-sqlite/src/Sql/Dml/Insert/InsertClauseParser.php:76
- method-call ZtdQuery\Platform\Sqlite\Sql\Dml\Insert\InsertClauseParser::hasInsertSelect() packages/ztd-query-sqlite/src/Sql/Dml/Insert/InsertClauseParser.php:86
- method-call ZtdQuery\Platform\Sqlite\Sql\Dml\Insert\InsertClauseParser::extractInsertSelect() packages/ztd-query-sqlite/src/Sql/Dml/Insert/InsertClauseParser.php:97
- method-call ZtdQuery\Platform\Sqlite\Sql\SqliteParser::stripComments() packages/ztd-query-sqlite/src/Sql/SqliteParser.php:256
- method-call ZtdQuery\Platform\Sqlite\Sql\Statement\StatementStructure::statementTail() packages/ztd-query-sqlite/src/Sql/Statement/StatementStructure.php:47
- method-call ZtdQuery\Platform\Sqlite\Sql\Statement\StatementStructure::statementTail() packages/ztd-query-sqlite/src/Sql/Statement/StatementStructure.php:52
- method-call ZtdQuery\Platform\Sqlite\Sql\Statement\TargetTableParser::extractCreateTableName() packages/ztd-query-sqlite/src/Sql/Statement/TargetTableParser.php:83
- method-call ZtdQuery\Platform\Sqlite\Sql\Statement\TargetTableParser::extractDropTableName() packages/ztd-query-sqlite/src/Sql/Statement/TargetTableParser.php:96
- method-call ZtdQuery\Platform\Sqlite\Sql\Statement\TargetTableParser::extractAlterTableName() packages/ztd-query-sqlite/src/Sql/Statement/TargetTableParser.php:109
Calls 2
- function-call
trimline 19 - static-call SqliteLexicalMasker::maskComments() line 19
public function maskStringLiterals(string $sql): stringMasks comments and string literals while preserving their byte offsets.
Parameters
$sql | string |
Returns
stringTest cases 2
Called from 1
Test cases 39§
Test cases that cover or call this symbol, from the coverage report and from the analyzed test sources.
Dedicated tests 13
LiteralMaskerTest::testMaskStringLiteralsStringLiteralMaskPreservesOffsetsAndQuotedIdentifierscallsLiteralMaskerTest::testMaskStringLiteralsUsesSqliteQuoteBoundariescallsLiteralMaskerTest::testStripCommentsPreservesContentcallsLiteralMaskerTest::testStripCommentsPreservesQuotedCommentMarkerscallsLiteralMaskerTest::testStripCommentsRemovesBlockCommentcallsLiteralMaskerTest::testStripCommentsRemovesHashCommentcallsLiteralMaskerTest::testStripCommentsRemovesLineCommentcallsLiteralMaskerTest::testStripCommentsStripBlockCommentcallsLiteralMaskerTest::testStripCommentsStripBlockCommentPreservesLexicalBoundaryWithoutSurroundingSpacescallsLiteralMaskerTest::testStripCommentsStripHashCommentcallsLiteralMaskerTest::testStripCommentsStripLineCommentcallsLiteralMaskerTest::testStripCommentsStripMultipleCommentscallsLiteralMaskerTest::testStripCommentsTrimsOuterWhitespacecalls
Other tests reaching this symbol 26
ReferencedTableLookupTestcallsMatchExpressionRewriterTestcallsSqliteFullTextSearchRewriterTestcallsSqliteQueryGuardTestcallsSqliteRewriterTestcallsStatementRewriterTestcallsDeleteTransformerTestcallsInsertProjectionBuilderTestcallsInsertTransformerTestcallsSelectTransformerTestcallsSqliteTransformerTestcallsUpdateTransformerTestcallsColumnDefinitionParserTestcallsTableDefinitionBuilderTestcallsVirtualTableParserTestcallsSqliteSchemaParserTestcallsAddColumnResolverTestcallsInsertMutationResolverTestcallsRowMutationResolverTestcallsTableMutationResolverTestcallsSqliteMutationResolverTestcallsInsertClauseParserTestcallsSqliteParserTestcallsStatementStructureTestcallsTargetTableParserTestcallsSqliteSessionFactoryTestcalls
Relations§
Instantiated in 14
- new ZtdQuery\Platform\Sqlite\Sql\Dml\Insert\InsertClauseParser::extractInsertColumns() packages/ztd-query-sqlite/src/Sql/Dml/Insert/InsertClauseParser.php:21
- new ZtdQuery\Platform\Sqlite\Sql\Dml\Insert\InsertClauseParser::extractInsertValues() packages/ztd-query-sqlite/src/Sql/Dml/Insert/InsertClauseParser.php:36
- new ZtdQuery\Platform\Sqlite\Sql\Dml\Insert\InsertClauseParser::hasOnConflict() packages/ztd-query-sqlite/src/Sql/Dml/Insert/InsertClauseParser.php:55
- new ZtdQuery\Platform\Sqlite\Sql\Dml\Insert\InsertClauseParser::isReplace() packages/ztd-query-sqlite/src/Sql/Dml/Insert/InsertClauseParser.php:64
- new ZtdQuery\Platform\Sqlite\Sql\Dml\Insert\InsertClauseParser::isInsertIgnore() packages/ztd-query-sqlite/src/Sql/Dml/Insert/InsertClauseParser.php:76
- new ZtdQuery\Platform\Sqlite\Sql\Dml\Insert\InsertClauseParser::hasInsertSelect() packages/ztd-query-sqlite/src/Sql/Dml/Insert/InsertClauseParser.php:86
- new ZtdQuery\Platform\Sqlite\Sql\Dml\Insert\InsertClauseParser::extractInsertSelect() packages/ztd-query-sqlite/src/Sql/Dml/Insert/InsertClauseParser.php:97
- new ZtdQuery\Platform\Sqlite\Sql\SqliteParser::stripComments() packages/ztd-query-sqlite/src/Sql/SqliteParser.php:256
- new ZtdQuery\Platform\Sqlite\Sql\SqliteParser::maskStringLiterals() packages/ztd-query-sqlite/src/Sql/SqliteParser.php:267
- new ZtdQuery\Platform\Sqlite\Sql\Statement\StatementStructure::statementTail() packages/ztd-query-sqlite/src/Sql/Statement/StatementStructure.php:47
- new ZtdQuery\Platform\Sqlite\Sql\Statement\StatementStructure::statementTail() packages/ztd-query-sqlite/src/Sql/Statement/StatementStructure.php:52
- new ZtdQuery\Platform\Sqlite\Sql\Statement\TargetTableParser::extractCreateTableName() packages/ztd-query-sqlite/src/Sql/Statement/TargetTableParser.php:83
- new ZtdQuery\Platform\Sqlite\Sql\Statement\TargetTableParser::extractDropTableName() packages/ztd-query-sqlite/src/Sql/Statement/TargetTableParser.php:96
- new ZtdQuery\Platform\Sqlite\Sql\Statement\TargetTableParser::extractAlterTableName() packages/ztd-query-sqlite/src/Sql/Statement/TargetTableParser.php:109
Method calls 14
- method-call ZtdQuery\Platform\Sqlite\Sql\Dml\Insert\InsertClauseParser::extractInsertColumns() packages/ztd-query-sqlite/src/Sql/Dml/Insert/InsertClauseParser.php:21
- method-call ZtdQuery\Platform\Sqlite\Sql\Dml\Insert\InsertClauseParser::extractInsertValues() packages/ztd-query-sqlite/src/Sql/Dml/Insert/InsertClauseParser.php:36
- method-call ZtdQuery\Platform\Sqlite\Sql\Dml\Insert\InsertClauseParser::hasOnConflict() packages/ztd-query-sqlite/src/Sql/Dml/Insert/InsertClauseParser.php:55
- method-call ZtdQuery\Platform\Sqlite\Sql\Dml\Insert\InsertClauseParser::isReplace() packages/ztd-query-sqlite/src/Sql/Dml/Insert/InsertClauseParser.php:64
- method-call ZtdQuery\Platform\Sqlite\Sql\Dml\Insert\InsertClauseParser::isInsertIgnore() packages/ztd-query-sqlite/src/Sql/Dml/Insert/InsertClauseParser.php:76
- method-call ZtdQuery\Platform\Sqlite\Sql\Dml\Insert\InsertClauseParser::hasInsertSelect() packages/ztd-query-sqlite/src/Sql/Dml/Insert/InsertClauseParser.php:86
- method-call ZtdQuery\Platform\Sqlite\Sql\Dml\Insert\InsertClauseParser::extractInsertSelect() packages/ztd-query-sqlite/src/Sql/Dml/Insert/InsertClauseParser.php:97
- method-call ZtdQuery\Platform\Sqlite\Sql\SqliteParser::stripComments() packages/ztd-query-sqlite/src/Sql/SqliteParser.php:256
- method-call ZtdQuery\Platform\Sqlite\Sql\SqliteParser::maskStringLiterals() packages/ztd-query-sqlite/src/Sql/SqliteParser.php:267
- method-call ZtdQuery\Platform\Sqlite\Sql\Statement\StatementStructure::statementTail() packages/ztd-query-sqlite/src/Sql/Statement/StatementStructure.php:47
- method-call ZtdQuery\Platform\Sqlite\Sql\Statement\StatementStructure::statementTail() packages/ztd-query-sqlite/src/Sql/Statement/StatementStructure.php:52
- method-call ZtdQuery\Platform\Sqlite\Sql\Statement\TargetTableParser::extractCreateTableName() packages/ztd-query-sqlite/src/Sql/Statement/TargetTableParser.php:83
- method-call ZtdQuery\Platform\Sqlite\Sql\Statement\TargetTableParser::extractDropTableName() packages/ztd-query-sqlite/src/Sql/Statement/TargetTableParser.php:96
- method-call ZtdQuery\Platform\Sqlite\Sql\Statement\TargetTableParser::extractAlterTableName() packages/ztd-query-sqlite/src/Sql/Statement/TargetTableParser.php:109