Overwrite Symfony constraint properties in constructors instead of child properties

Created on 13 March 2024, 9 months ago
Updated 28 March 2024, 8 months ago

Problem/Motivation

Discovered in πŸ“Œ Symfony 7 compatibility Active and πŸ“Œ Symfony deprecations in Constraint plugins Fixed and already handled for one case in #3276196: The "Symfony\Component\Validator\Constraints\Range::$minMessage" property is considered final β†’ , Symfony considers public and protected class properties to be final. Validator constraint messages are declared as properties and where we need to override these (usually because we change the way they are formatted) we have done it by redeclaring the properties.

Steps to reproduce

https://git.drupalcode.org/issue/drupal-3394694/-/jobs/990299

Look for "Property ...Constraint... overriding property ... should also have native type ..."

Proposed resolution

Switch AllowedValuesConstraint, CountConstraint, LengthConstraint and RegexConstraint to use the constructor technique used in RangeConstraint from #3276196: The "Symfony\Component\Validator\Constraints\Range::$minMessage" property is considered final β†’ .

Remaining tasks

User interface changes

API changes

Data model changes

Release notes snippet

πŸ“Œ Task
Status

Fixed

Version

10.3 ✨

Component
BaseΒ  β†’

Last updated about 13 hours ago

Created by

πŸ‡¬πŸ‡§United Kingdom longwave UK

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

Production build 0.71.5 2024