8000 [Validator] Moved constraints Optional and Required to the Constraints\ namespace by webmozart · Pull Request #7701 · symfony/symfony · GitHub
[go: up one dir, main page]

Skip to content

[Validator] Moved constraints Optional and Required to the Constraints\ namespace #7701

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

Merged
merged 1 commit into from
Apr 19, 2013

Conversation

webmozart
Copy link
Contributor
Q A
Bug fix? no
New feature? no
BC breaks? no
Deprecations? yes
Tests pass? yes
Fixed tickets -
License MIT
Doc PR symfony/symfony-docs#2512

/**
* @author Bernhard Schussek <bschussek@gmail.com>
*/
abstract class Existence extends Constraint
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what is the goal of this abstract class you are introducing ? This looks weird as you are not even uisng it for the instanceof checks

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It was introduced because Optional and Required are two constraints of a kind that will probably always have identical functionality (I discovered that when trying to fix #4453 but didn't have time to complete this fix).

fabpot added a commit that referenced this pull request Apr 19, 2013
This PR was merged into the master branch.

Discussion
----------

[Validator] Moved constraints Optional and Required to the Constraints\ namespace

| Q             | A
| ------------- | ---
| Bug fix?      | no
| New feature?  | no
| BC breaks?    | no
| Deprecations? | yes
| Tests pass?   | yes
| Fixed tickets | -
| License       | MIT
| Doc PR        | symfony/symfony-docs#2512

Commits
-------

a868048 [Validator] Moved constraints Optional and Required to the Constraints\ namespace
@fabpot fabpot closed this Apr 19, 2013
@fabpot fabpot merged commit a868048 into symfony:master Apr 19, 2013
@jakzal
Copy link
Contributor
jakzal commented May 29, 2014

@webmozart why were these classes moved? As far as I can tell they can only work with the collection constraint. Is that correct (see #11014)?

@stof
Copy link
Member
stof commented May 30, 2014

@jakzal to make it easier to use them without a second use statement (in Yaml or XML, it would require to either define namespace aliases or use the FQCN otherwise)

@jakzal
Copy link
Contributor
jakzal commented May 30, 2014

@stof cool, thanks! I thought there was an idea of using them outside of the Collection constraint. Looks like not ;)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants
0