Problem/Motivation

This is the error phpstan is complaining about in the GitLab CI pipeline.

 ------ ----------------------------------------------------------------------- 
  Line   color/color.inc                                                        
 ------ ----------------------------------------------------------------------- 
  127    Call to deprecated function theme_get_setting():                       
         in drupal:11.3.0 and is removed from drupal:13.0.0. Use                
                                                                                
         \Drupal::service('Drupal\Core\Extension\ThemeSettingsProvider')->getS  
         etting()                                                               
           instead.                                                             
         🪪  function.deprecated                                                
 ------ ----------------------------------------------------------------------- 
 [ERROR] Found 1 error   

Steps to reproduce

Proposed resolution

Update as recommended.

Remaining tasks

User interface changes

API changes

Data model changes

Issue fork bartik-3585478

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

solideogloria created an issue. See original summary.

solideogloria’s picture

Status: Active » Needs review
solideogloria’s picture

Issue tags: +PHPStan
solideogloria’s picture

The latest commit should fix the phpstan error for previous major.

liam morland’s picture

Status: Needs review » Needs work

Thanks for the patch.

Is there a reason the service is identified once as theme.settings_provider and once as Drupal\Core\Extension\ThemeSettingsProvider? If the latter is to be used, I would rather it be ThemeSettingsProvider::class.

There should be a @todo about removing this once 11.3 is the lowest supported version.

solideogloria’s picture

Status: Needs work » Needs review

Oh, didn't notice that. Yeah, it should be consistent. Updated

solideogloria’s picture

The reason for it is that is what phpstan recommended. See the issue summary

liam morland’s picture

Title: Fix deprecation for Drupal 11.3 » Start removal of deprecated theme_get_setting()

I made it use @phpstan-ignore instead of a file.

liam morland’s picture

Status: Needs review » Fixed

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.

Status: Fixed » Closed (fixed)

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