Skip to content

Fix Symfony 7.4 Request::get() deprecation in scopeFilteredByRequest#156

Open
jensbaagaard wants to merge 1 commit into
masterfrom
jba/fix-symfony-7.4-request-get-deprecation
Open

Fix Symfony 7.4 Request::get() deprecation in scopeFilteredByRequest#156
jensbaagaard wants to merge 1 commit into
masterfrom
jba/fix-symfony-7.4-request-get-deprecation

Conversation

@jensbaagaard
Copy link
Copy Markdown
Contributor

Summary

  • Replace $request->get(...) with $request->query(...) in RequestInsurance::scopeFilteredByRequest() (the admin index filter scope).
  • Silences the Symfony 7.4 deprecation warning that fires on every page load of the request-insurances admin UI:

    Since symfony/http-foundation 7.4: Request::get() is deprecated, use properties ->attributes, query or request directly instead.

  • The admin filter form submits via GET, so query() is the precise, behavior-preserving replacement (previously get() would also fall back to attributes and request body, neither of which carry these inputs).

Why

Symfony deprecated Request::get() because of its ambiguous lookup order across attributes, query, then request bags — a long-standing source of subtle bugs. Picking query() here narrows the lookup to query-string params, which is what the form actually sends.

Test plan

  • CI: existing PHPUnit suite passes.
  • Manual: load the request-insurances admin index in any consuming service (e.g. money-limits) and confirm the deprecation no longer appears in logs.
  • Manual: exercise each filter input — state checkboxes, url, trace_id, from, to — and confirm filtering still works.

🤖 Generated with Claude Code

Replace $request->get(...) with $request->query(...) in the request-insurances
admin index filter scope. Symfony 7.4 deprecates Request::get() because of its
ambiguous lookup order across attributes/query/request bags. The admin filter
form is a GET form, so query() is the precise replacement.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant