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 Done
    • Christian Kuhn +2
  • Verified V +2 Done
    • Christian Kuhn +2
    • core-ci +1 CI

Issues 1

Files 3

Review log 1015

  1. Stefan Bürk uploaded patch set 1 03/02/22, 12:57

  2. core-ci voted on patch set 1 V +1 03/02/22, 13:09 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/24457

  3. Oliver Klee updated the commit message in patch set 2 03/02/22, 13:12

  4. Stefan Bürk updated the commit message in patch set 3 03/02/22, 13:39

  5. Stefan Bürk commented on patch set 3 03/02/22, 14:10

    Backport notes: ``` Kept docblock argument types from v11 for: * ExpressionBuilder::andX(...) * ExpressionBuilder::orX(...) but added "@see" lines to add a first awareness for the new methods ```
  6. Stefan Bürk commented on patch set 3 03/02/22, 14:12

    Reply

    Additional notes: * patchset 2 failed to trigger a pipeline run, so no vote. * patchset 3 triggered pipeline run, which was green. but vote got lost. However started a nightly run on patchset 3: https://git.typo3.org/typo3/CI/cms/-/pipelines/24463
  7. core-ci voted on patch set 3 V -1 03/02/22, 14:34 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/24463

  8. core-ci voted on patch set 3 V +1 03/02/22, 14:41 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/24463

  9. Stefan Bürk commented on patch set 3 03/02/22, 15:00

    Reply

    First nightly failure was a acceptance hickup :/
  10. Stefan Bürk updated the commit message in patch set 4 03/02/22, 15:34

  11. core-ci voted on patch set 4 V +1 03/02/22, 15:43 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/24470

  12. Christian Kuhn rebased onto patch set 5 03/04/22, 21:01

  13. core-ci voted on patch set 5 V +1 03/04/22, 21:16 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/24593

  14. Christian Kuhn voted on patch set 5 V +2 CR +2 03/04/22, 21:18

  15. Christian Kuhn merged patch set 6 03/04/22, 21:18