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

A cast named by its source and target types: ( source AS target ).

Source: https://www.postgresql.org/docs/17/sql-dropcast.html.

Reading the target typedoctest
$text = 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('text')])));
    $mood = 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('mood')])));
    (new \SqlSemantics\Platform\PostgreSql\Statement\Object\Reference\CastPair($text, $mood))->target === $mood // => true

Properties§

public TypeName $source
public TypeName $target

Methods§

public function __construct(public TypeName $source, public TypeName $target)

Parameters

$sourceTypeNameThe source type
$targetTypeNameThe target type
public function deriveClause(Derivation $derivation, Environment $environment): void

Derives the type modifiers.

Parameters

$derivationDerivation
$environmentEnvironment
Test cases 1
Calls 1
public function render(Output $out): void

Writes the types in parentheses.

Parameters

$outOutput
Test cases 1
Calls 1

Test cases 5§

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

Dedicated tests 2
Other tests reaching this symbol 3

Relations§

Instantiated in 3
Type checks 1