classGrouped
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.
$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 // => trueProperties§
public Scalar $operandMethods§
public function __construct(public Scalar $operand)Parameters
$operand | Scalar | The grouped expression |
public function deriveScalar(Derivation $derivation, Environment $environment): ScalarFactDerives the operand; the grouping has its facts.
Parameters
$derivation | Derivation | |
$environment | Environment |
Returns
Calls 2
- method-call Derivation::scalar() line 46
- new ScalarFact line 48
public function render(Output $out): voidTest 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
FormRuleTest::testLowerLowersTheBracketedAndColumnFormscallsNumericContextTest::testClassifyFollowsTheTypeAndTreatsAHexadecimalLiteralAsAnUnsignedIntegercallsItemNamingTest::testNameAnswersTheAliasTheColumnNameOrTheTextcallsItemNamingTest::testOwnAnswersTheNamesOfTheItemsThatNameThemselvescallsSortScopesTest::testWordAnswersABareUnqualifiedNamecalls
Relations§
Instantiated in 1
Type checks 6
- instanceof SqlSemantics\Platform\MySql\Rules\Dml\GeneratedWrites::default() packages/sql-semantics-mysql/src/Rules/Dml/GeneratedWrites.php:134
- instanceof SqlSemantics\Platform\MySql\Rules\Expression\NumericContext::classify() packages/sql-semantics-mysql/src/Rules/Expression/NumericContext.php:44
- instanceof SqlSemantics\Platform\MySql\Rules\Expression\NumericResult::bits() packages/sql-semantics-mysql/src/Rules/Expression/NumericResult.php:117
- instanceof SqlSemantics\Platform\MySql\Rules\Expression\NumericResult::beyond() packages/sql-semantics-mysql/src/Rules/Expression/NumericResult.php:154
- instanceof SqlSemantics\Platform\MySql\Rules\Query\ItemNaming::own() packages/sql-semantics-mysql/src/Rules/Query/ItemNaming.php:133
- instanceof SqlSemantics\Platform\MySql\Rules\Query\SortScopes::word() packages/sql-semantics-mysql/src/Rules/Query/SortScopes.php:94