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
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:
- 3383339-replace-implementing-deprecated
changes, plain diff MR !4644
Comments
Comment #2
spokjePlease don't tell me this would be a BC-break?
The only difference between
ArgumentValueResolverInterfaceandValueResolverInterfaceis thatArgumentValueResolverInterfacehaspublic function supports(Request $request, ArgumentMetadata $argument): bool;Comment #4
spokjeComment #5
smustgrave commentedChange looks good.
Comment #6
catchWill need a re-roll after #3383279: Bump mglaman/phpstan-drupal to latest to make daily "updated deps" QA run pass again
Comment #7
spokjeRerolled with PHPStan baseline suppression removed and re-RTBC-ed, since there were no code changes.
Comment #8
spokjeComment #10
catchThe 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.
Comment #12
spokjeFollow-up in #3383548: Deprecate Psr7RequestValueResolver::supports and RouteMatchValueResolver::supports.