Review main Merged

73610[TASK] Deprecate QueryBuilder::execute()

Stefan Bürk CR +2 V +2 Normal +86 −1 updated 02/21/22, 18:44

Commit message

doctrine/dbal already deprecated the combined 'execute()'
method in favour of the streamlined 'executeQuery()' and
'executeStatement()'. These method has been added to the
core facade QueryBuilder with #96247 with proper backport
so extension developer can adopt this and support two core
versions without deprecations or nasty workarounds.

With the raise of doctrine/dbal to ^3.2 the facade class
uses the concrete methods directly which has not been there
before. Furthermore all core usages has been adopted to the
replacement methods with #96551.

'QueryBuilder::executeStatement()'

This method is suitable for all INSERT, UPDATE or DELETE
queries build with QueryBuilder. Or to say shortly, these
kind of queries which only returns an integer value stating
the number of the affected rows (number of deleted, updated
or inserted rows).

'QueryBuilder::executeQuery()'

This method is suitable for all SELECT or COUNT queries, or
to say shortly, these kind of queries returning a resultset.

This patch finally deprecates 'QueryBuilder::execute()', which
helps avoiding to slip in old 'execute()' calls undetectable
through reviews and furthermore avoid corresponding phpstan
errors on higher level (which core is not there yet). Not adding
this to extension scanner as this would emit a lot of missleading
weak hits because of extbase 'excute()' method and upgrade wizard
execute() methods.

Review

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

Issues 3

Files 2

Review log 1421

  1. Stefan Bürk uploaded patch set 1 02/20/22, 00:29

  2. Stefan Bürk updated the commit message in patch set 2 02/20/22, 00:30

  3. core-ci voted on patch set 1 V +1 02/20/22, 00:42 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/23917

  4. core-ci voted on patch set 2 V -1 02/20/22, 00:43 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/23918

  5. core-ci voted on patch set 2 V +1 02/20/22, 00:45 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/23918

  6. Stefan Bürk uploaded patch set 3 02/20/22, 15:29

  7. core-ci voted on patch set 3 V +1 02/20/22, 15:38 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/23944

  8. Nikita Hovratov commented on patch set 3 02/20/22, 15:55

    Deprecation-96972-DeprecateQueryBuilderexecute.rst:20

    extension developers

    Deprecation-96972-DeprecateQueryBuilderexecute.rst:38

    Extensions

    Deprecation-96972-DeprecateQueryBuilderexecute.rst:39

    TYPO3

    Deprecation-96972-DeprecateQueryBuilderexecute.rst:46

    return

    Deprecation-96972-DeprecateQueryBuilderexecute.rst:76

    replaced
  9. Nikita Hovratov commented on patch set 3 02/20/22, 15:57

    Deprecation-96972-DeprecateQueryBuilderexecute.rst:25

    Articles missing for "method"
  10. Stefan Bürk uploaded patch set 4 02/20/22, 16:04

  11. Stefan Bürk uploaded patch set 5 02/20/22, 16:05

  12. Stefan Bürk commented on patch set 5 02/20/22, 16:06

    Deprecation-96972-DeprecateQueryBuilderexecute.rst:20 Reply

    Done

    Deprecation-96972-DeprecateQueryBuilderexecute.rst:25 Reply

    Done

    Deprecation-96972-DeprecateQueryBuilderexecute.rst:38 Reply

    Done

    Deprecation-96972-DeprecateQueryBuilderexecute.rst:39 Reply

    Done

    Deprecation-96972-DeprecateQueryBuilderexecute.rst:46 Reply

    Done

    Deprecation-96972-DeprecateQueryBuilderexecute.rst:76 Reply

    Done
  13. core-ci voted on patch set 4 V +1 02/20/22, 16:27 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/23948

  14. Stefan Bürk updated the commit message in patch set 6 02/20/22, 16:41

  15. core-ci voted on patch set 6 V +1 02/20/22, 16:57 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/23953

  16. core-ci voted on patch set 5 V +1 02/20/22, 17:14 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/23949

  17. Benni Mack commented on patch set 6 02/21/22, 07:22

    should we add this to our ExtensionScanner rules?
  18. Benni Mack voted on patch set 6 CR +1 02/21/22, 07:35

  19. Benni Mack voted on patch set 6 V +1 02/21/22, 08:30

  20. Christian Kuhn voted on patch set 6 V +2 CR +2 02/21/22, 18:44

  21. Christian Kuhn merged patch set 7 02/21/22, 18:44