• stefan.buerk's avatar
    [TASK] Use proper QueryBuilder execute() replacement methods · 597a92fd
    stefan.buerk authored and Benni Mack's avatar Benni Mack committed
    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.
    Resolves: #96551
    Related: #96247
    Related: #96521
    Releases: main, 11.5
    Change-Id: Ie8d40f3882f1694ab7f7e5053729fa1c798a9c5f
    Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/73032
    Tested-by: default avatarChristian Kuhn <lolli@schwarzbu.ch>
    Tested-by: default avatarcore-ci <typo3@b13.com>
    Tested-by: default avatarBenni Mack <benni@typo3.org>
    Reviewed-by: default avatarChristian Kuhn <lolli@schwarzbu.ch>
    Reviewed-by: default avatarBenni Mack <benni@typo3.org>