IBX-12046: Removed Symfony 8 deprecated code usage - #92
Open
ViniTou wants to merge 1 commit into
Open
Conversation
Replaced the deprecated Request::get() call in ConditionallyRemoveVaryHeaderListener with the explicit attributes bag access, since the route name is a route attribute, not a query/request parameter.
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



Related PRs:
Description:
Symfony 8.0 removes
Request::get(). This repo had one direct call to it inConditionallyRemoveVaryHeaderListener::onKernelResponse(), reading thecurrent route name (
_route) off the request to decide whether to strip theVaryheader._routeis a route attribute, so the fix replaces$event->getRequest()->get('_route')with$event->getRequest()->attributes->get('_route').The unit test mocked
Request::get()directly, which silently hid thedeprecation (mocks never execute the real, deprecated method). It now
constructs a real
Requestand sets the_routeattribute on it, so thetest actually exercises the code path.
No BC-breaking constraint changes were needed: the other static-scan hit
(
TagHandler::__construct()callingparent::__construct($options)) extendsFOS's
SymfonyResponseTagger(which extendsFOS\HttpCache\ResponseTagger),not a Symfony
Constraintsubclass, so the#[HasNamedArguments]recipe doesnot apply there.
For QA:
Exercise any route configured under
ibexa_http_cache.remove_default_vary_cookie_headers(or equivalent config consuming
ConditionallyRemoveVaryHeaderListener) andconfirm the
Varyheader is still stripped ofCookie/Authorizationformatched routes, and left untouched for other routes.
Documentation:
N/A