Review main Merged

73833[TASK] Replace 'CompositeExpression->add()' usage

Stefan Bürk CR +2 V +2 Normal +32 −32 updated 03/07/22, 13:21

Commit message

doctrine/dbal moves their classes forward and deprecated
some stuff while providing replacement for it. This has
been early adopted for the core facade classes with #97081
in a forward-compatible way. Before deprecating the old
methods core usage have to be replaced.

This patch replaces the usage of 'CompositeExpression::add()'
with the immutable way using 'with()' with re-assigning the
returned instance to the used variable.

In general this means that following usage example:

  $or = CompositeExpression::or();
  $or->add($queryBuilder->expr()->eq(...));

will be replaced with:

  $or = CompositeExpression::or();
  $or = $or->with($queryBuilder->expr()->eq(...));

Alternativly this could be refactored collecting parts in a
array first and add them later with one 'with()' call or by
directly creating the 'or()' or 'and()' CompositeExpression
with the provided parts directly - which would have been a
larger and harder to review patch. Thus this patch does the
simple replacement to have minimal changes for easier review
experience.

Review

  • Code review CR +2 Done
    • Benni Mack +2
    • Nikita Hovratov +1
  • Verified V +2 Done
    • Benni Mack +2
    • Nikita Hovratov +1
    • core-ci +1 CI

Issues 2

Files 11

Review log 811

  1. Stefan Bürk uploaded patch set 1 03/06/22, 16:59

  2. core-ci voted on patch set 1 V +1 03/06/22, 17:07 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/24641

  3. Stefan Bürk updated the commit message in patch set 2 03/06/22, 17:09

  4. core-ci voted on patch set 2 V +1 03/06/22, 17:21 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/24642

  5. Nikita Hovratov commented on patch set 2 03/06/22, 17:28

    experience
  6. Stefan Bürk updated the commit message in patch set 3 03/06/22, 21:19

  7. Stefan Bürk commented on patch set 3 03/06/22, 21:19

    Reply

    Done
  8. core-ci voted on patch set 3 V +1 03/06/22, 21:31 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/24645

  9. Nikita Hovratov voted on patch set 3 V +1 CR +1 03/07/22, 06:46

  10. Benni Mack voted on patch set 3 V +2 CR +2 03/07/22, 13:21

  11. Benni Mack merged patch set 4 03/07/22, 13:21