Review main Merged

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

Stefan Bürk CR +2 V +2 Expert +672 −655 updated 01/18/22, 12:43

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

Issues 3

Files 196

Show 176 more files

Review log 1927

Show 12 earlier messages
  1. Stefan Bürk uploaded patch set 1 01/15/22, 22:19

  2. core-ci voted on patch set 1 V +1 01/15/22, 22:37 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/22128

  1. Stefan Bürk updated the commit message in patch set 2 01/15/22, 23:00

  2. Stefan Bürk marked it ready for review 01/15/22, 23:01

  3. core-ci voted on patch set 2 V +1 01/15/22, 23:14 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/22129

  4. Stefan Bürk commented on patch set 2 01/15/22, 23:16

  5. core-ci voted on patch set 2 V -1 01/15/22, 23:50 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/22130

  6. core-ci voted on patch set 2 V +1 01/15/22, 23:57 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/22130

  7. Stefan Bürk wrote 01/16/22, 08:48

    Topic set to doctrine/dbal
  8. Stefan Bürk uploaded patch set 3 01/16/22, 08:52

  9. Stefan Bürk commented on patch set 3 01/16/22, 08:55

    Backport is currently relative easily doable even if this is a cross-spread patch - which may change. - remove 1 file from cherry-pick (new event in main) - solve one simple/minor conflict in 1 file
  10. core-ci voted on patch set 3 V +1 01/16/22, 09:07 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/22137

  11. Stefan Bürk rebased onto patch set 4 01/16/22, 21:44

  12. core-ci voted on patch set 4 V +1 01/16/22, 21:59 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/22157

  13. Benni Mack updated the commit message in patch set 5 01/17/22, 07:24

  14. core-ci voted on patch set 5 V +1 01/17/22, 07:37 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/22172

  15. Benni Mack voted on patch set 5 V +1 CR +1 01/17/22, 08:48

  16. Christian Kuhn voted on patch set 5 V +1 CR +1 01/17/22, 18:43

  17. Benni Mack commented on patch set 5 01/18/22, 09:36

    aaargh, now it has a merge conflcit.
  18. Stefan Bürk commented on patch set 5 01/18/22, 09:37

    yes - merged impexp patch from lolli :/ Will rebase it in the lunch break .. backport "should" be still doable, but little bit more work. If backport is wanted I would do it then. Or should we drop the backport directly ?
  19. Christian Kuhn commented on patch set 5 01/18/22, 09:38

    Reply

    that was me in impexp PresetRepository. rather easy to solve, i guess stefan will take care soon. we should then reach a merge quickly to avoid further rebase hell for this one.
  20. Stefan Bürk uploaded patch set 6 01/18/22, 09:59

  21. Christian Kuhn voted on patch set 6 V +1 CR +1 01/18/22, 10:11

  22. Stefan Bürk commented on patch set 6 01/18/22, 10:12

    Already prepared backport. Changes documented on backport
  23. core-ci voted on patch set 6 V +1 01/18/22, 10:17 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/22213

  24. Benni Mack voted on patch set 6 V +2 CR +2 01/18/22, 12:43

  25. Benni Mack merged patch set 7 01/18/22, 12:43