final class Grouped
    implements Scalar
    uses Snapshot
Public API: explicitly declared with @visibility public.

An expression in grouping parentheses: ( expr ).

The grouping is kept as written: it decides how the operators around it associate, and it is closed on both edges.

Rule: MYSQL-GROUPED-001. Facts: those of the grouped expression. Terminates: the operand is a strict part. Source: https://dev.mysql.com/doc/refman/8.4/en/operator-precedence.html. Status: Implemented.

Keeping a grouping that changes the associationdoctest
$query = (new \SqlSemantics\Platform\MySql\Semantics())->analyze('SELECT a FROM t WHERE a AND (b OR c)');
    $query->statement->where->right instanceof \SqlSemantics\Platform\MySql\Statement\Expression\Grouped // => true

Properties§

public Scalar $operand

Methods§

public function __construct(public Scalar $operand)

Parameters

$operandScalarThe grouped expression
public function deriveScalar(Derivation $derivation, Environment $environment): ScalarFact

Derives the operand; the grouping has its facts.

Parameters

$derivationDerivation
$environmentEnvironment

Returns

Calls 2
public function render(Output $out): void

Writes the operand in parentheses.

Parameters

$outOutput
Calls 1

Test cases 7§

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 5

Relations§

Instantiated in 1
Type checks 6