final class CaseBranch
    implements Node
    uses Snapshot
Public API: explicitly declared with @visibility public.

One WHEN branch of a CASE expression.

Reading a branchdoctest
$query = (new \SqlSemantics\Platform\Sqlite\Semantics())->analyze("SELECT CASE WHEN a THEN 'x' END FROM t");
    $query->statement->columns[0]->expression->branches[0]->then->value // => 'x'

Properties§

public Scalar $when
public Scalar $then

Methods§

public function __construct(public Scalar $when, public Scalar $then)

Parameters

$whenScalarThe condition, or the value compared with the base expression
$thenScalarThe result of the branch
public function render(Output $out): void

Writes the branch.

Parameters

$outOutput
Calls 1

Test cases 1§

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

Dedicated tests 1

Relations§

Instantiated in 1
Constant reads 1