Skip to content

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

Open
ViniTou wants to merge 2 commits into
6.0from
ibx-12046-symfony-deprecations
Open

IBX-12046: Removed Symfony 8 deprecated code usage#145
ViniTou wants to merge 2 commits 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:

Removes usages of Symfony 8-removed APIs while staying on Symfony 7.4, so this repo's unit and SQLite integration suites report zero direct Symfony deprecations:

  • Request::get() in UserRegisterController::registerFromInvitationAction() replaced with $request->attributes->get('inviteHash') (the value is a route path attribute).
  • Password, EmailInvitation and UserPassword validator constraints (src/lib/Validator/Constraints/) gained a #[HasNamedArguments] constructor mirroring Symfony 7.4's own constraints (e.g. core's UniqueIdentifier). The options-array form is dropped outright: 6.0 is a major, Symfony 8 removes it from Constraint anyway, and no package in the organisation instantiates these constraints with an array.
  • The two in-repo call sites that built Password from a positional options array (UserPasswordChangeType, UserPasswordResetType) were updated to use named arguments, as were the test call sites.

Confirmed nothing outside this repo instantiates or extends these three constraint classes (searched all ibexa/* repos on 6.0, including admin-ui, corporate-account and content-forms), so no merge-order coordination is required.

No dependency majors were touched (Symfony stays on ^7.4, no PHPUnit/rector changes).

For QA:

  • Exercise user registration from an invitation link (/from-invite/register/{inviteHash} and /user/from-invite/register/{inviteHash}) to confirm the invite hash is still read correctly.
  • Exercise the "change password" and "forgot/reset password" forms (UserPasswordChangeType, UserPasswordResetType) to confirm password-strength validation against a user's content type still works.

Documentation:

Ibexa\User\Validator\Constraints\Password, EmailInvitation and UserPassword now have an explicit, named-argument constructor (contentType, user, message, groups, payload for Password; message, groups, payload for the other two). The options-array form is no longer accepted.

Replaced Request::get() with an explicit attributes bag lookup in
UserRegisterController, and aligned the Password, EmailInvitation and
UserPassword validator constraints with the Symfony 7.4 constructor
contract (#[HasNamedArguments], BC-preserving options array with a
deprecation notice for external callers). Updated the two in-repo form
types that instantiated Password with a positional options array to
use named arguments instead.
…constraints

6.0 is a major and Symfony 8 removes options-array support from Constraint itself; the form types already use
named arguments and no other package instantiates Password, EmailInvitation or UserPassword.
@sonarqubecloud

Copy link
Copy Markdown

Quality Gate Failed Quality Gate failed

Failed conditions
8.3% Duplication on New Code (required ≤ 3%)

See analysis details on SonarQube Cloud

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.

3 participants