Problem/Motivation

There is some dead code in PdoTrait.

Steps to reproduce

Search for the methods in the entire core codebase.

Proposed resolution

Deprecate for removal in Drupal 13.

Remaining tasks

User interface changes

Introduced terminology

API changes

Data model changes

Release notes snippet

Issue fork drupal-3611847

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

mondrake created an issue. See original summary.

mondrake’s picture

Title: Deprecated unused PdoTrait code » Deprecate unused PdoTrait code

mondrake’s picture

Status: Active » Needs review
danielveza’s picture

Verified the dead code is not used in Core, and fleshed out the CR to include more info and match some other deprecation CRs.

I think this is ready for RTBC, but since I did the CR changes, I guess it should stay NR.

dcam’s picture

Status: Needs review » Reviewed & tested by the community
Related issues: +#3522561: Fully type StatementInterface methods' parameters

search.tresbien.tech doesn't show any usage of these functions. pdoToFetchAs() was made irrelevant by #3522561: Fully type StatementInterface methods' parameters. There were no usage results for the other functions at all. The code changes and change record look good. I did a little editing on the CR to improve the grammar and formatting, but I don't have any additional feedback.

catch’s picture

Status: Reviewed & tested by the community » Needs work

Not sure why given it's new, but needs a rebase.

catch’s picture

Status: Needs work » Reviewed & tested by the community

Because I was on the wrong branch...

catch’s picture

Version: main » 11.x-dev
Status: Reviewed & tested by the community » Patch (to be ported)

Committed/pushed to main, thanks!

Needs a backport MR for 11.x

mondrake’s picture

Looks like the push did not get through.

  • catch committed 9be85405 on main
    task: #3611847 Deprecate unused PdoTrait code
    
    By: mondrake
    By:...

mondrake’s picture

Very strange the protected array $fetchModeLiterals is present in main head but not in 11.x head. The backport MR reinstates in 11.x what is missing.

mondrake’s picture

Status: Patch (to be ported) » Needs review
dcam’s picture

Status: Needs review » Needs work

5 months ago we moved $fetchModeLiterals from core/lib/Drupal/Core/Database/FetchModeTrait.php to PdoTrait as part of #3525077: Remove deprecated paths from the Database API & friends. They still exist in the 11.x FetchModeTrait.

mondrake’s picture

Status: Needs work » Needs review

#16 thanks for the digging; moved the deprecation location.

dcam’s picture

Status: Needs review » Reviewed & tested by the community

Looks good. The changes mirror what was committed to main, with the addition of telling PHPStan to ignore uses of the deprecated pdoToFetchAs() function.