final class ExpressionBinder
Restricted visibility: declared "@visibility root". Code outside that scope must not name this declaration.

Expression binder operations for PostgreSQL upsert.

Methods§

public function __construct(
    non-empty-list<string> $incomingNamespaces,
    IdentifierQuoter $quoter,
)

Supplies the dependencies used by this ExpressionBinder.

Parameters

$incomingNamespacesnon-empty-list<string>
$quoterIdentifierQuoter
public function bindExpression(
    string $expression,
    string $tableName,
    list<string> $tableColumns,
    string $unqualifiedAlias = self::EXISTING_ALIAS,
): string
public function subqueryTokenIndexes(list<SqlToken> $tokens): array<int, true>
public function qualifiedReplacement(
    SqlToken $token,
    SqlToken $afterNext,
    string $name,
    string $tableName,
    array<string, true> $incomingNamespaces,
): array{offset: int, length: int, value: string}|null

Binds only an incoming or target-table qualifier, leaving other namespaces untouched.

Parameters

$tokenSqlToken
$afterNextSqlToken
$namestring
$tableNamestring
$incomingNamespacesarray<string, true>

Returns

array{offset: int, length: int, value: string}|null
Test cases 1
Called from 1
Calls 8
public function applyReplacements(
    string $expression,
    list<array{offset: int, length: int, value: string}> $replacements,
): string

Replaces bound identifiers from right to left to preserve earlier source offsets.

Parameters

$expressionstring
$replacementslist<array{offset: int, length: int, value: string}>

Returns

string
Test cases 1
Called from 1
Calls 2

Private surface 4§

Implementation details, listed for orientation only.

private const INCOMING_ALIAS = '__ztd_incoming'
private const EXISTING_ALIAS = '__ztd_existing'
private non-empty-list<string> $incomingNamespaces
private IdentifierQuoter $quoter

Test cases 14§

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

Dedicated tests 6
Other tests reaching this symbol 8

Relations§

Instantiated in 4
Method calls 4