Skip to content

IBX-12046: Removed Symfony 8 deprecated code usage - #92

Open
ViniTou wants to merge 1 commit into
6.0from
ibx-12046-symfony-deprecations
Open

IBX-12046: Removed Symfony 8 deprecated code usage#92
ViniTou wants to merge 1 commit into
6.0from
ibx-12046-symfony-deprecations

Conversation

@ViniTou

@ViniTou ViniTou commented Sep 9, 2026

Copy link
Copy Markdown
Contributor
🎫 Issue IBX-12046

Related PRs:

Description:

Symfony 8.0 removes Request::get(). This repo had one direct call to it in
ConditionallyRemoveVaryHeaderListener::onKernelResponse(), reading the
current route name (_route) off the request to decide whether to strip the
Vary header. _route is 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 the
deprecation (mocks never execute the real, deprecated method). It now
constructs a real Request and sets the _route attribute on it, so the
test actually exercises the code path.

No BC-breaking constraint changes were needed: the other static-scan hit
(TagHandler::__construct() calling parent::__construct($options)) extends
FOS's SymfonyResponseTagger (which extends FOS\HttpCache\ResponseTagger),
not a Symfony Constraint subclass, so the #[HasNamedArguments] recipe does
not apply there.

For QA:

Exercise any route configured under ibexa_http_cache.remove_default_vary_cookie_headers
(or equivalent config consuming ConditionallyRemoveVaryHeaderListener) and
confirm the Vary header is still stripped of Cookie/Authorization for
matched routes, and left untouched for other routes.

Documentation:

N/A

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.
@sonarqubecloud

sonarqubecloud Bot commented Sep 9, 2026

Copy link
Copy Markdown

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant