final class SqlParameterReader

Reads a placeholder standing in for a value the driver will bind.

A placeholder is written either by position, where the whole of it is one run of bytes the profile measures, or by name, where a prefix is followed by a name that may itself be spelled in parts. Which prefixes, separators and suffixes a dialect allows are all asked of the profile.

Methods§

public function endOfName(
    string $sql,
    int $offset,
    string $prefix,
    SqlLexerProfile $profile,
): int

Answers where the name of a placeholder ends.

A name may be spelled in parts, joined by whatever the dialect allows; a separator only joins when a further name follows it, so a trailing one is left to be read as something else.

Parameters

$sqlstringThe statement, as written
$offsetintWhere the name starts
$prefixstringThe prefix the placeholder was written with
$profileSqlLexerProfileWhat the dialect spells things with

Returns

int The offset just past the name
Test cases 5
Called from 1
Calls 4

Test cases 12§

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

Dedicated tests 8
Other tests reaching this symbol 4

Relations§

Instantiated in 1
Method calls 1
Type declarations 1