-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
[DoctrineBridge] Loosened CollectionToArrayTransformer::transform() to accept ReadableCollection #57935
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
[DoctrineBridge] Loosened CollectionToArrayTransformer::transform() to accept ReadableCollection #57935
Conversation
Hey! I see that this is your first PR. That is great! Welcome! Symfony has a contribution guide which I suggest you to read. In short:
Review the GitHub status checks of your pull request and try to solve the reported issues. If some tests are failing, try to see if they are failing because of this change. When two Symfony core team members approve this change, it will be merged and you will become an official Symfony contributor! I am going to sit back now and wait for the reviews. Cheers! Carsonbot |
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.
Thanks for the PR!
I think it's worth adding a test for this interface to (in the CollectionToArrayTransformerTest
class).
src/Symfony/Bridge/Doctrine/Form/DataTransformer/CollectionToArrayTransformer.php
Show resolved
Hide resolved
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.
Please add a test that covers your change.
cf7ff3a
to
9ff3541
Compare
src/Symfony/Bridge/Doctrine/Form/DataTransformer/CollectionToArrayTransformer.php
Outdated
Show resolved
Hide resolved
9ff3541
to
fba7361
Compare
fba7361
to
5bc90a1
Compare
src/Symfony/Bridge/Doctrine/Form/DataTransformer/CollectionToArrayTransformer.php
Outdated
Show resolved
Hide resolved
src/Symfony/Bridge/Doctrine/Form/DataTransformer/CollectionToArrayTransformer.php
Outdated
Show resolved
Hide resolved
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.
with a few CS changes
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.
Thanks for the quick actions, @timdev !
The right solution for that could be a conflict rule instead. |
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.
👍🏻 Once @xabbuh's remarks have been addressed.
5bc90a1
to
5c705d5
Compare
Updated with @xabbuh's fixes. |
…o accept ReadableCollection Since 1.8.0 doctrine/collections ships ReadableCollection, which the Collection interface extends. This commit relaxes the behavior of CollectionToArrayTransformer::transform(), allowing it to transform instances of ReadableCollection.
5c705d5
to
a13f0ac
Compare
Thank you @timdev. |
Since 1.8.0 doctrine/collections ships ReadableCollection, which the Collection interface extends. This commit relaxes the behavior of CollectionToArrayTransformer::transform(), allowing it to tranform instances of ReadableCollection.
Since 1.8.0 doctrine/collections ships ReadableCollection, which the Collection interface extends. This commit relaxes the behavior of CollectionToArrayTransformer::transform(), allowing it to transform instances of ReadableCollection.
This change does not break BC, but does make
doctrine/collections
a non-dev dependency in order to require at least1.8.0
of that library (previously, the lower-bound version was implicitly^1.5
viadoctrine/o[rd]m
. This is one of several reasons why I'm considering this an addition and not a bugfix. Symfony maintainers are, of course, welcome to backport this patch to earlier versions of the framework at their discretion.I've omitted a test here, since the signal:noise ratio would be poor due the the necessary inclusion of a boilerplate ReadableCollection implementation. I'm happy to add one if desired, however.