final class OperatorSignature
    implements ObjectReference
    uses Snapshot
Public API: explicitly declared with @visibility public.

An operator named with its operand types, as operator_with_argtypes writes it.

Mirrors PostgreSQL's ObjectWithArgs for operators. The operator name may be schema-qualified without the OPERATOR(...) syntax. Source: https://www.postgresql.org/docs/17/sql-dropoperator.html.

Reading a prefix operator signaturedoctest
$type = new \SqlSemantics\Platform\PostgreSql\Statement\Type\TypeName(new \SqlSemantics\Platform\PostgreSql\Statement\Type\Designation\NamedDesignation(new \SqlSemantics\Platform\PostgreSql\Statement\Name\DottedName([new \SqlSemantics\Platform\PostgreSql\Model\Statement\Identifier\Name('int4')])));
    $signature = new \SqlSemantics\Platform\PostgreSql\Statement\Routine\Signature\OperatorSignature(new \SqlSemantics\Platform\PostgreSql\Statement\Name\OperatorName(new \SqlSemantics\Platform\PostgreSql\Model\Statement\Identifier\Name('-')), \SqlSemantics\Platform\PostgreSql\Statement\Routine\Signature\OperatorArity::Prefix, [$type]);
    [$signature->left(), $signature->right() === $type] // => [null, true]

Properties§

public non-empty-list<TypeName> $types
public OperatorName $operator
public OperatorArity $arity

Methods§

public function __construct(
    public OperatorName $operator,
    public OperatorArity $arity,
    list<TypeName> $types,
)

Parameters

$operatorOperatorNameThe operator, written without the OPERATOR(...) syntax
$arityOperatorArityHow the operand types are written
$typeslist<TypeName>The written operand types, as many as the arity writes
Calls 5
public function left(): ?TypeName

Answers the left operand type, or null when there is none.

Returns

Test cases 1
Calls 4
public function right(): ?TypeName

Answers the right operand type, or null when there is none.

Returns

Test cases 1
Calls 4
public function deriveClause(Derivation $derivation, Environment $environment): void
public function render(Output $out): void

Writes the operator and its operand types.

Parameters

$outOutput
Test cases 1
Calls 8

Test cases 10§

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 4

Relations§

Instantiated in 4
Method calls 1
Type checks 2
Type declarations 4