8000 [Bridge] [Doctrine] [Validator] Added support \IteratorAggregate for UniqueEntityValidator by Disparity · Pull Request #17078 · symfony/symfony · GitHub
[go: up one dir, main page]

Skip to content

[Bridge] [Doctrine] [Validator] Added support \IteratorAggregate for UniqueEntityValidator #17078

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

Disparity
Copy link
Contributor
Q A
Bug fix? no
New feature? no
BC breaks? no
Deprecations? no
Tests pass? yes
Fixed tickets
License MIT
Doc PR

Expand the list of supported types of results returned from the repositories.
Added processing of type \IteratorAggregate (and as a consequence doctrine Collection)

@Disparity Disparity changed the title [Bridge / Doctrine / Validator] Added support \IteratorAggregate for UniqueEntityValidator [Bridge] [Doctrine] [Validator] Added support \IteratorAggregate for UniqueEntityValidator Dec 20, 2015
@nicolas-grekas
Copy link
Member

Can you please add a test case?

@Disparity Disparity force-pushed the feature-bridge-doctrine-unique-validator-support-collection branch 3 times, most recently from e0847b0 to 93d00be Compare December 27, 2015 07:06
@Disparity
Copy link
Contributor Author

@nicolas-grekas, I added tests to check the functionality different types of "Collections".

@nicolas-grekas
Copy link
Member

👍

@xabbuh
Copy link
Member
xabbuh commented Dec 28, 2015

Is this supposed to be a bugfix or a new feature?

@Disparity
Copy link
Contributor Author

@xabbuh, these changes are closer to a new feature than to bug fixes.
This allows the validator working with traversable results (which include doctrine collection), and not only with iterators and arrays.

array($entity, new \ArrayIterator(array($entity))),
array($entity, new ArrayCollection(array($entity))),
);
}
Copy link
Member

Choose a reason for hiding this comment

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

Imo for better readability the data provider should be near (above or below) the test method.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I looked existing code - not so simple, there are different tests in different approaches. But I agree that the data provider close to the test easier to read. Fixed.

Expand the list of supported types of results returned from the repositories.
Added processing of type \IteratorAggregate (and as a consequence doctrine Collection)
@Disparity Disparity force-pushed the feature-bridge-doctrine-unique-validator-support-collection branch from 93d00be to db49aae Compare January 10, 2016 07:25
@fabpot
Copy link
Member
fabpot commented Jan 10, 2016

👍 I would consider this a bugfix rather than a new feature.

@xabbuh
Copy link
Member
xabbuh commented Jan 11, 2016

👍 for merging this into Symfony 2.3

@fabpot
Copy link
Member
fabpot commented Jan 11, 2016

Thank you @Disparity.

fabpot added a commit that referenced this pull request Jan 11, 2016
…regate for UniqueEntityValidator (Disparity)

This PR was submitted for the 2.8 branch but it was merged into the 2.3 branch instead (closes #17078).

Discussion
----------

[Bridge] [Doctrine] [Validator] Added support \IteratorAggregate for UniqueEntityValidator

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

Expand the list of supported types of results returned from the repositories.
Added processing of type \IteratorAggregate (and as a consequence doctrine Collection)

Commits
-------

6ebd179 Added support \IteratorAggregate for UniqueEntityValidator
@fabpot fabpot closed this Jan 11, 2016
This was referenced Jan 14, 2016
@fabpot fabpot mentioned this pull request Feb 3, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants
0