IBX-12046: Removed Symfony 8 deprecated code usage - #349
Open
ViniTou wants to merge 2 commits into
Open
Conversation
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.
|
konradoboza
approved these changes
Sep 11, 2026
mikadamczyk
approved these changes
Sep 11, 2026
| @@ -16,4 +17,18 @@ | |||
| class RichText extends Constraint | |||
Contributor
There was a problem hiding this comment.
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.
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:
Prepares this repository for Symfony 8 by fixing the one Symfony-deprecation-prone pattern found here:
Ibexa\FieldTypeRichText\Validator\Constraints\RichTextextendedSymfony\Component\Validator\Constraintwithout its own constructor. Added a#[HasNamedArguments]constructor mirroring Symfony 7.4's own simple constraints (e.g.Json,IsTrue): namedmessage,groupsandpayloadarguments only; the options-array form is dropped outright (6.0 is a major, Symfony 8 removes it fromConstraintanyway, and every call site in this repo,fieldtype-pageandsite-contextconstructsRichText/IsValidRichTextwith zero arguments). No other categories from the recipe (Request::get(), Twigapp.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 withSYMFONY_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\RichTextmust be instantiated with named (or positional) arguments:new RichText(message: '…'). The options-array form is no longer accepted.