Review 11.5 Merged

73055[TASK] Use proper QueryBuilder execute() replacement methods

Stefan Bürk CR +2 V +2 Expert +671 −654 updated 01/18/22, 12:44

Commit message

doctrine/dbal implemented single purpose method to replace the
compound 'execute()' in QueryBuilder to avoid the incompatible
return typehint tuple of 'Doctrine\DBAL\Result|int' in favour
of 'executeQuery()' and 'executeStatement()' which was added
forward-compatible with #96247 marking the old one internal
but not deprecated for now to keep a eventually longer grace
period to mitigate for extensions developers.

This patch however goes through the core and replace these
methods to be clean as possible and is a first preparation
to remove the 'checkThisOnly' option from phpstan which are
swallowed by this option.

* replace 'execute' with 'executeQuery()' for select and
  count queries generating results ('Doctrine\DBAL\Result').
* use 'executeStatement()' for insert, update and delete
  queries return affected rows as return value (int)
* adjust return typehints to match the single return type
  signature on really minor places to match the return type
  of the wrapped replaced execute method.
* replace one really old 'exec()' from connection with
  corresponding replacement method along the way.
* add several todos on two places which are weird and do
  not make any sense for further investigation and fixing,
  as declared as out-of-the-scope for this wide-area patch.

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 3

Files 195

Show 175 more files