-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
[Validator] Add canonicalize
option for Locale
validator
#22353
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
canonicalize
option for Locale
validatorcanonicalize
option for Locale
validator
e769c77
to
ac83b88
Compare
/** | ||
* {@inheritdoc} | ||
*/ | ||
public function __construct($options = null) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we need constructor with custom code here?
/** | ||
* {@inheritdoc} | ||
*/ | ||
public function getDefaultOption() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does this method relates to validator class?
Moving to 4.1. Rebase on master might be needed, where PHP 7.1 features can be used btw. |
ac83b88
to
8babc2c
Compare
@Koc, sorry for the delay. Your comments were already addressed. |
8babc2c
to
b07d5a7
Compare
Thank you @phansys. |
Thinking about this feature (after merging it), would it make sense to always canolicalize the value instead of making it configurable? |
IMO, it would be really useful to allow this validator to always canonicalize the input data, but I think this behavior will break the current "strictness" and thus, that change should be considered a BC break. |
@phansys Can you work on a PR to generate a deprecation message when canoicalize is |
Sure @fabpot, I'll be working on it 👍 |
…raint without setting "canonicalize" option to `true` (phansys) This PR was merged into the 4.1-dev branch. Discussion ---------- [Validator] Deprecate use of `Locale` validation constraint without setting "canonicalize" option to `true` |Q |A | |--- |--- | |Branch |master | |Bug fix? |no | |New feature? |no | |BC breaks? |no | |Deprecations?|yes | |Tests pass? |yes | |Fixed tickets|#22353 | |License |MIT | |Doc PR |symfony/symfony-docs#9248| See symfony/symfony#22353 (comment). Commits ------- 1572540a3a Deprecate use of `Locale` validation constraint without setting "canonicalize" option to `true`
…raint without setting "canonicalize" option to `true` (phansys) This PR was merged into the 4.1-dev branch. Discussion ---------- [Validator] Deprecate use of `Locale` validation constraint without setting "canonicalize" option to `true` |Q |A | |--- |--- | |Branch |master | |Bug fix? |no | |New feature? |no | |BC breaks? |no | |Deprecations?|yes | |Tests pass? |yes | |Fixed tickets|#22353 | |License |MIT | |Doc PR |symfony/symfony-docs#9248| See #22353 (comment). Commits ------- 1572540 Deprecate use of `Locale` validation constraint without setting "canonicalize" option to `true`
…` validation constraint (phansys, javiereguiluz) This PR was merged into the master branch. Discussion ---------- [Validator] Add docs for "canonicalize" option at `Locale` validation constraint Related to symfony/symfony#22353, symfony/symfony#26075. Closes #7660. Commits ------- 14f10bc Final changes 4c28e1f Minor changes 0cc4ee8 Add docs for "canonicalize" option at `Locale` validation constraint
Allow non canonicalized locales ('fr-FR' by instance) to pass the validation.
Relates to symfony/symfony-docs#7660.