Skip to content

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

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

IBX-12046: Removed Symfony 8 deprecated code usage#349
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:

Prepares this repository for Symfony 8 by fixing the one Symfony-deprecation-prone pattern found here: Ibexa\FieldTypeRichText\Validator\Constraints\RichText extended Symfony\Component\Validator\Constraint without its own constructor. Added a #[HasNamedArguments] constructor mirroring Symfony 7.4's own simple constraints (e.g. Json, IsTrue): named message, groups and payload arguments only; the options-array form is dropped outright (6.0 is a major, Symfony 8 removes it from Constraint anyway, and every call site in this repo, fieldtype-page and site-context constructs RichText/IsValidRichText with zero arguments). No other categories from the recipe (Request::get(), Twig app.request.get(), voters, OptionsResolver nested defaults, ArgumentValueResolverInterface, symfony/templating, implicit nullables, Twig extension return types, PostMountEvent) were found in this repository, by static grep or by running the unit/integration suites with SYMFONY_DEPRECATIONS_HELPER.

For QA:

Exercise RichText field validation (content edit forms using the RichText field type) to confirm validation messages still render correctly.

Documentation:

Ibexa\FieldTypeRichText\Validator\Constraints\RichText must be instantiated with named (or positional) arguments: new RichText(message: '…'). The options-array form is no longer accepted.

Added #[HasNamedArguments] constructor to the RichText validator
constraint (mirrors Symfony's own 7.4 constraint pattern), preserving
BC for the legacy options-array signature via a deprecation notice.
No other Symfony 8 deprecation patterns (Request::get(), voters,
OptionsResolver nested defaults, etc.) are present in this repository.
…xt constraint

6.0 is a major and Symfony 8 removes options-array support from Constraint itself; every caller in the
organisation (this package, fieldtype-page, site-context) instantiates the constraint without arguments.
@sonarqubecloud

Copy link
Copy Markdown

@@ -16,4 +17,18 @@
class RichText extends Constraint

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

While we're already touching this class's constructor, would it make sense to also mark it final? It doesn't seem to be extended anywhere in this repo, fieldtype-page, or site-context, and it would match the other constraint classes converted in this same effort. No worries if there's a reason to keep it open.

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.

4 participants