Problem/Motivation
As per the title, constraints must use named arguments instead of options arrays.
Steps to reproduce
Proposed resolution
Convert calls to constraint constructors.
Figure out if we need to provide backward compatibility or custom deprecations for contrib.
Remaining tasks
User interface changes
Introduced terminology
API changes
Data model changes
Release notes snippet
Issue fork drupal-3555533
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
- 3555533-validator-options-array
changes, plain diff MR !13698
Comments
Comment #2
godotislateSome of the work in MR 12291 for #3522497: Passing an $options array to constraint constructors is deprecated, use named arguments instead may be relevant.
Comment #4
longwaveTurns out the code for ValidSequenceKeysConstraint is the same as the Existence plugin in Symfony so we can just extend that instead.
Comment #5
godotislateInteresting that Existence doesn't have the HasNamedArguments attribute, but seems to work here all the same since ContainerFactoryPluginInterface classes are instantiated differently. I have vague concerns that
ValidSequenceKeysConstraintdoes not semantically inherit fromExistencethe wayRequiredandOptionaldo, but the code reuse convenience overrides that for me.lgtm.
Comment #6
longwaveTBH I looked at Required and Optional and given they contain no code at all I don't see how they work, but there must be special support for them somewhere, so Existence seemed to be the cleaner option to extend from.
Comment #9
catchCommitted/pushed to 11.x and cherry-picked to 11.3.x, thanks!