Review main Merged

81771[TASK] Avoid direct usages of `\PDO::PARAM_*` constants again

Stefan Bürk CR +2 V +2 Easy +10 −8 updated 11/19/23, 18:28

Commit message

Recently, the `ext:styleguide` has been integrated with full commit
history as a system extension into the mono repository.

That added code to the mono repository, which was not covered
with #98649 which modified most userland code to use

a) `Connection::PARAM_*` constants instead of `\PDO::PARAM_*` constants

This is due to also another change from Doctrine DBAL 3 [1]
which can easily be changed in TYPO3's Source Code to ensure
easy upgrade paths and showing best practices for extension
authors looking into TYPO3 Source Code

b) Avoid using constants from `\Doctrine\DBAL\Connection`
   but use our own constants.

Even though Doctrine DBAL 3.x introduces "ParameterType" objects,
we use our own connection implementation for the time being
as we also seek to backport such changes in TYPO3 v11.

c) Avoid using the Connection::PARAM_STR for ->createNamedParameter
as second argument, as this is the default value.

All of these changes will make the upgrade path towards Doctrine
DBAL 4.x easier.

This change modified the styleguide code to reflect these changes.

[1] https://github.com/doctrine/dbal/blob/3.4.x/UPGRADE.md#bc-break-the-pdo-symbols-are-no-longer-part-of-the-dbal-api

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 2

Files 2