Problem/Motivation
As discovered in #3394694: [Meta] Symfony 7 compatibility, see PHPUnit test results, we have a few occurrences in unit tests where we use Symfony\Component\HttpFoundation\ParameterBag where we can/should use the more specific bags Symfony\Component\HttpFoundation\InputBag and Symfony\Component\HttpFoundation\HeaderBag.
With the current Symfony 6.x this is all fine, but from Symfony 7.0 we get test-failures similar to
TypeError: Cannot assign Mock_ParameterBag_0d737a6f to property Symfony\Component\HttpFoundation\Request::$query of type Symfony\Component\HttpFoundation\InputBag
Steps to reproduce
Proposed resolution
We can already tighten the used classes and make the MR to jump to Symfony 7 a bit smaller.
Remaining tasks
User interface changes
API changes
Data model changes
Release notes snippet
Issue fork drupal-3429403
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:
- 3429403-tighten-parameterbag-classes
changes, plain diff MR !7065
Comments
Comment #3
spokjeComment #4
spokjeComment #5
spokjeComment #6
spokjeComment #7
longwaveLooks great, thanks for picking this up and sorting it out.
Comment #8
alexpottCommitted and pushed 1feb93274a to 11.x and 5085b5a08f to 10.3.x and cb28194e8e to 10.2.x. Thanks!
Backported to 10.2.x to keep tests aligned.