This repository has been archived on 2023-08-20. You can view files and clone it, but cannot push or open issues or pull requests.
symfony/src/Symfony/Component/Validator/Constraints
Fabien Potencier 1de60c902c merged branch ricardclau/rename_choice_to_oneof (PR #6360)
This PR was merged into the master branch.

Commits
-------

9071676 create oneof constraint and add deprecation messages in choice, also make choice extend new oneOf constraint to avoid duplicate code

Discussion
----------

[Validator] Rename "Choice" to "OneOf"

Bug fix: no
Feature addition: yes
Backwards compatibility break: no
Symfony2 tests pass: yes
Fixes the following tickets: #6324
Todo:
License of the code: MIT
Documentation PR: https://github.com/symfony/symfony-docs/issues/2025

---------------------------------------------------------------------------

by bschussek at 2012-12-14T18:20:56Z

Can you let `Choice` and `ChoiceValidator` extend the renamed classes? Then we avoid the code duplication. You can also remove `ChoiceValidatorTest` then.

---------------------------------------------------------------------------

by ricardclau at 2012-12-14T18:26:58Z

For sure! BTW there seems to be a problem with SF2 build when testing BR currency :S maybe it is the new ICU version supported, I guess you are aware of this but just in case!

---------------------------------------------------------------------------

by stof at 2012-12-14T21:14:04Z

the ``Choice`` constraint should trigger a ``E_USER_DEPRECATED`` in its constructor (and calling the parent constructor) as we agreed on this. The PR adding these calls everywhere is not merged yet, but it would avoid missing it when merging the PRs separately

---------------------------------------------------------------------------

by bschussek at 2012-12-14T21:19:45Z

Things missing:

* add a deprecation note to the Validator's CHANGELOG
* add a block in UPGRADE-2.2 under the Validator's "Deprecations" section that explains how to upgrade with a before/after sample
* add `trigger_error()` calls to the constructors of `Choice` and `ChoiceValidator`

See #6180 for more information about how to call `trigger_error()`.

---------------------------------------------------------------------------

by ricardclau at 2012-12-14T22:45:55Z

Sorry I was not aware of the trigger_error() agreement, absolutely +1 on it.

I hope I understood everything properly, if there is something else or some other errors please tell me!

---------------------------------------------------------------------------

by bschussek at 2012-12-15T08:46:51Z

The entry in the CHANGELOG is still missing.

---------------------------------------------------------------------------

by ricardclau at 2012-12-15T09:36:28Z

By the CHANGELOG you mean what I just added right? Hope now it is ok!

---------------------------------------------------------------------------

by bschussek at 2012-12-15T09:45:16Z

Awesome! 👍
2012-12-15 13:25:28 +01:00
..
Collection [Validator] Moved Optional and Required constraints to dedicated sub namespace. 2012-01-16 11:30:56 +01:00
All.php [Validator] Improved error messages displayed when the Valid constraint is misused 2012-07-11 18:23:09 +02:00
AllValidator.php [Validator] Added inheritDoc phpdoc for validate methods 2012-07-14 17:42:20 -07:00
Blank.php Added missing dot to translation messages. 2012-04-13 21:43:24 +02:00
BlankValidator.php [Validator] Added inheritDoc phpdoc for validate methods 2012-07-14 17:42:20 -07:00
Callback.php [Validator] tagged the public @api 2011-07-20 10:37:57 +02:00
CallbackValidator.php [Validator] Added inheritDoc phpdoc for validate methods 2012-07-14 17:42:20 -07:00
CardScheme.php Serbian translation for card scheme constraint message. 2012-12-12 13:18:02 +01:00
CardSchemeValidator.php Added CardScheme validator 2012-07-27 09:25:56 +10:00
Choice.php create oneof constraint and add deprecation messages in choice, also make choice extend new oneOf constraint to avoid duplicate code 2012-12-15 10:29:01 +01:00
ChoiceValidator.php create oneof constraint and add deprecation messages in choice, also make choice extend new oneOf constraint to avoid duplicate code 2012-12-15 10:29:01 +01:00
Collection.php [Validator] Improved error messages displayed when the Valid constraint is misused 2012-07-11 18:23:09 +02:00
CollectionValidator.php Code cleanup 2012-10-22 10:37:12 -04:00
Count.php [Validator] Removed MinCount and MaxCount and replaced them by the constraint Count 2012-07-11 19:47:53 +02:00
Country.php Added missing dot to translation messages. 2012-04-13 21:43:24 +02:00
CountryValidator.php [Validator] Added inheritDoc phpdoc for validate methods 2012-07-14 17:42:20 -07:00
CountValidator.php [Validator] Added inheritDoc phpdoc for validate methods 2012-07-14 17:42:20 -07:00
Date.php Added missing dot to translation messages. 2012-04-13 21:43:24 +02:00
DateTime.php Added missing dot to translation messages. 2012-04-13 21:43:24 +02:00
DateTimeValidator.php [Validator] Removed return value from ConstraintValidatorInterface::isValid() 2012-04-17 16:46:43 +02:00
DateValidator.php [Validator] Added inheritDoc phpdoc for validate methods 2012-07-14 17:42:20 -07:00
Email.php Added missing dot to translation messages. 2012-04-13 21:43:24 +02:00
EmailValidator.php [Validator] Added inheritDoc phpdoc for validate methods 2012-07-14 17:42:20 -07:00
False.php Added missing dot to translation messages. 2012-04-13 21:43:24 +02:00
FalseValidator.php [Validator] Added inheritDoc phpdoc for validate methods 2012-07-14 17:42:20 -07:00
File.php separate numeric value from suffix in File constraint's error message $uploadIniSizeErrorMessage 2012-05-11 23:15:32 +02:00
FileValidator.php [Validator] Added inheritDoc phpdoc for validate methods 2012-07-14 17:42:20 -07:00
GroupSequence.php Fixing email 2012-05-26 09:48:33 +02:00
GroupSequenceProvider.php [Validator] GroupSequenceProvider tests improved, configuration changed 2012-02-02 20:27:50 +01:00
Image.php Added missing dot to translation messages. 2012-04-13 21:43:24 +02:00
ImageValidator.php [Validator] Added inheritDoc phpdoc for validate methods 2012-07-14 17:42:20 -07:00
Ip.php fixed CS 2012-07-09 14:54:20 +02:00
IpValidator.php [Validator] Added inheritDoc phpdoc for validate methods 2012-07-14 17:42:20 -07:00
Language.php Added missing dot to translation messages. 2012-04-13 21:43:24 +02:00
LanguageValidator.php [Validator] Added inheritDoc phpdoc for validate methods 2012-07-14 17:42:20 -07:00
Length.php [Validator] Added Length constraint and deprecated MinLength and MaxLength 2012-07-11 19:48:02 +02:00
LengthValidator.php [Validator] Added inheritDoc phpdoc for validate methods 2012-07-14 17:42:20 -07:00
Locale.php Added missing dot to translation messages. 2012-04-13 21:43:24 +02:00
LocaleValidator.php [Validator] Added inheritDoc phpdoc for validate methods 2012-07-14 17:42:20 -07:00
Luhn.php Serbian translation for Luhn constraint message. 2012-12-12 13:11:42 +01:00
LuhnValidator.php Add Luhn validator 2012-07-27 09:26:41 +10:00
Max.php [Validator] Trigger errors for deprecations 2012-12-06 21:23:28 +01:00
MaxLength.php [Validator] Trigger errors for deprecations 2012-12-06 21:23:28 +01:00
MaxLengthValidator.php [Validator] Trigger errors for deprecations 2012-12-06 21:23:28 +01:00
MaxValidator.php [Validator] Trigger errors for deprecations 2012-12-06 21:23:28 +01:00
Min.php [Validator] Trigger errors for deprecations 2012-12-06 21:23:28 +01:00
MinLength.php [Validator] Trigger errors for deprecations 2012-12-06 21:23:28 +01:00
MinLengthValidator.php [Validator] Trigger errors for deprecations 2012-12-06 21:23:28 +01:00
MinValidator.php [Validator] Trigger errors for deprecations 2012-12-06 21:23:28 +01:00
NotBlank.php Added missing dot to translation messages. 2012-04-13 21:43:24 +02:00
NotBlankValidator.php [Validator] Added inheritDoc phpdoc for validate methods 2012-07-14 17:42:20 -07:00
NotNull.php Added missing dot to translation messages. 2012-04-13 21:43:24 +02:00
NotNullValidator.php [Validator] Added inheritDoc phpdoc for validate methods 2012-07-14 17:42:20 -07:00
Null.php Added missing dot to translation messages. 2012-04-13 21:43:24 +02:00
NullValidator.php [Validator] Added inheritDoc phpdoc for validate methods 2012-07-14 17:42:20 -07:00
OneOf.php create oneof constraint and add deprecation messages in choice, also make choice extend new oneOf constraint to avoid duplicate code 2012-12-15 10:29:01 +01:00
OneOfValidator.php create oneof constraint and add deprecation messages in choice, also make choice extend new oneOf constraint to avoid duplicate code 2012-12-15 10:29:01 +01:00
Range.php Typo fix 2012-09-17 11:30:49 +04:00
RangeValidator.php [Validator] Added inheritDoc phpdoc for validate methods 2012-07-14 17:42:20 -07:00
Regex.php fixed CS 2012-12-11 11:40:22 +01:00
RegexValidator.php [Validator] Added inheritDoc phpdoc for validate methods 2012-07-14 17:42:20 -07:00
Time.php Added missing dot to translation messages. 2012-04-13 21:43:24 +02:00
TimeValidator.php [Validator] Added inheritDoc phpdoc for validate methods 2012-07-14 17:42:20 -07:00
True.php Added missing dot to translation messages. 2012-04-13 21:43:24 +02:00
TrueValidator.php [Validator] remove return value in TrueValidator 2012-07-19 23:47:59 +03:00
Type.php Added missing dot to translation messages. 2012-04-13 21:43:24 +02:00
TypeValidator.php [Validator] Added inheritDoc phpdoc for validate methods 2012-07-14 17:42:20 -07:00
Url.php Added missing dot to translation messages. 2012-04-13 21:43:24 +02:00
UrlValidator.php [Validator] Added inheritDoc phpdoc for validate methods 2012-07-14 17:42:20 -07:00
Valid.php [Validator] Improved error messages displayed when the Valid constraint is misused 2012-07-11 18:23:09 +02:00