Review 11.5 Merged

73766[TASK] Provide forward-compatible CompositeExpression/ExpressionBuilder

Stefan Bürk CR +2 V +2 Normal +152 −16 updated 03/04/22, 21:18

Commit message

doctrine/dbal changed their API and usage for CompositeExpression
and ExpressionBuilder with 4.0, which they already deprecated in
3.x.

To avoid a big drift over time core has to follow these changes
in the provided facade implementations, but keep the
core promises up. Furthermore this paves the way to be able to
raise doctrine/dbal:^4.0 later without being breaking. At least
this is one preparation for this goal, not the last.

To give extension developers the ability to support their extensions
for two core versions without doing dirty hacks to avoid deprecation
messages spammed into the logs, this patch provides the new methods
as a forward-compatible backport change. Core usages and the finally
deprecation will be done in dedicated follow up patches for the
main branch.

This patch provides following new methods:

* static 'CompositeExpression::and()' and 'or()' as drop-in
  replacement for 'new CompositeExpress( $type , array $parts)',
  where $type is 'and' or 'or'
* 'ExpressionBuilder::and()' as drop-in replacement for 'andX()'
* 'ExpressionBuilder::or()' as drop-in replacement for 'orX()'

Argument types of the new methods will be made strict with the
following deprecation patch as union types are not supported
by all required PHP versions for v11.5.

Review

  • Code review CR +2

    Imported before Forger kept the single votes, the next import adds them.

  • Verified V +2

    Imported before Forger kept the single votes, the next import adds them.

Issues 1

Files 3