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

    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 2