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

    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 2

Files 11