final class SqlBlockCommentReader

Reads a block comment, opening to closing.

Which pair of delimiters writes a block comment, and whether one comment may hold another, are both the dialect's business, so they are asked of the profile. A comment left unclosed runs to the end of the statement, because there is nothing further to close it with.

Methods§

public function endAt(string $sql, int $offset, SqlLexerProfile $profile): int|null

Answers where the block comment starting at an offset ends.

Parameters

$sqlstringThe statement, as written
$offsetintWhere to look
$profileSqlLexerProfileWhat the dialect spells things with

Returns

int|null The offset just past the closing delimiter, or null when no comment starts there
Test cases 5
Called from 1
Calls 4

Test cases 10§

Test cases that cover or call this symbol, from the coverage report and from the analyzed test sources.

Dedicated tests 5
Other tests reaching this symbol 5

Relations§

Instantiated in 1
Method calls 1
Type declarations 1