Problem/Motivation

In order to clean up file.module we want to move file_icon_class() and file_icon_map() to a utility class and deprecate.

These functions have no service dependencies, so can be static methods.

Steps to reproduce

Proposed resolution

Move file_icon_class() and file_icon_map() to a utility class and deprecate.

Remaining tasks

User interface changes

API changes

Data model changes

Release notes snippet

Issue fork drupal-3411266

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

kim.pepper created an issue. See original summary.

kim.pepper’s picture

Status: Active » Needs review
smustgrave’s picture

Status: Needs review » Reviewed & tested by the community
Issue tags: +Needs Review Queue Initiative

Applied the MR and searched for file_icon_class + file_icon_class and only one instance of each which was deprecated.

Tests are added to show deprecation, https://git.drupalcode.org/issue/drupal-3411266/-/jobs/544804

LGTM

quietone made their first commit to this issue’s fork.

quietone’s picture

I moved the cspell:ignore line. It should be before the class declaration and after any use statements. I used the Web IDE an had the pleasure of making the change twice. :-)

Leaving at RTBC.

longwave’s picture

Status: Reviewed & tested by the community » Fixed

Wondered if it was worth making this extensible or swappable but I searched the issue queue and found no issues discussing either of these, so I think this is fine just to move to a static utility class, especially given each method only has exactly one usage in core.

Committed c936bda and pushed to 11.x. Thanks!

  • longwave committed c936bda0 on 11.x
    Issue #3411266 by kim.pepper, quietone, smustgrave: Convert...

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.