Problem/Motivation

As (soon to be) discovered by mglaman/phpstan-drupal 1.2.0 (see #3383279: Bump mglaman/phpstan-drupal to latest to make daily "updated deps" QA run pass again), we are using some deprecated functionality throughout Drupal core.

This issue is for dealing with:

 ------ ------------------------------------------------------------------------------- 
  Line   core/lib/Drupal/Core/Controller/ArgumentResolver/Psr7RequestValueResolver.php  
 ------ ------------------------------------------------------------------------------- 
  15     Class                                                                          
         Drupal\Core\Controller\ArgumentResolver\Psr7RequestValueResolver               
         implements deprecated interface                                                
         Symfony\Component\HttpKernel\Controller\ArgumentValueResolverInterface:        
         since Symfony 6.2, implement ValueResolverInterface instead                    
 ------ ------------------------------------------------------------------------------- 

and


 ------ ------------------------------------------------------------------------------ 
  Line   core/lib/Drupal/Core/Controller/ArgumentResolver/RouteMatchValueResolver.php  
 ------ ------------------------------------------------------------------------------ 
  15     Class Drupal\Core\Controller\ArgumentResolver\RouteMatchValueResolver         
         implements deprecated interface                                               
         Symfony\Component\HttpKernel\Controller\ArgumentValueResolverInterface:       
         since Symfony 6.2, implement ValueResolverInterface instead                   
 ------ ------------------------------------------------------------------------------ 

Note: Depending on the landing of #3383279: Bump mglaman/phpstan-drupal to latest to make daily "updated deps" QA run pass again before the landing of this issue, we also might need to remove two suppressions from core/phpstan-baseline.neon

Steps to reproduce

Proposed resolution

since we're on SF >= 6.2 in 10.1.x and 11.x: Remove implementing the deprecated interface, in both cases we're also implementing the proposed one.

User interface changes

API changes

Data model changes

Release notes snippet

Issue fork drupal-3383339

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

Spokje created an issue. See original summary.

spokje’s picture

Please don't tell me this would be a BC-break?

The only difference between ArgumentValueResolverInterface and ValueResolverInterface is that ArgumentValueResolverInterface has public function supports(Request $request, ArgumentMetadata $argument): bool;

spokje’s picture

Status: Active » Needs review
smustgrave’s picture

Status: Needs review » Reviewed & tested by the community

Change looks good.

catch’s picture

Status: Reviewed & tested by the community » Needs work
spokje’s picture

Status: Needs work » Reviewed & tested by the community

Rerolled with PHPStan baseline suppression removed and re-RTBC-ed, since there were no code changes.

spokje’s picture

Issue summary: View changes

  • catch committed 12dabf05 on 11.x
    Issue #3383339 by Spokje: Replace implementing deprecated interface...
catch’s picture

Status: Reviewed & tested by the community » Fixed
Issue tags: +Needs followup

The class still implements the method so from that point of view it's not a bc break. The class no longer implements the interface - this would be a problem if these were supposed to be type hinted anywhere, but they're only used by http bridge so I think that's OK too (although I hope I'm not wrong).

However, do we need a follow-up to deprecate and then remove methods like Psr7RequestValueResolver::supports() in 11.x? Should be cruft now.

spokje’s picture

Status: Fixed » Closed (fixed)

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