This repository has been archived by the owner on Jan 8, 2020. It is now read-only.
[BC] Remove need of setter in ClassMethods hydrator #2426
Closed
bakura10
wants to merge
4
commits into
zendframework:master
from
bakura10:hydrator/remove-setter-need
Closed
[BC] Remove need of setter in ClassMethods hydrator #2426
bakura10
wants to merge
4
commits into
zendframework:master
from
bakura10:hydrator/remove-setter-need
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@@ -123,20 +123,6 @@ public function testHydratorClassMethodsCamelCase() | |||
$this->assertEquals($test->hasBar(), false); | |||
} | |||
|
|||
public function testHydratorClassMethodsCamelCaseWithSetterMissing() |
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.
You should to update the test instead of removing no ?
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.
I did not really understand it to be honest. I can't understand the use case nor the test, so I can't really update it :/.
@@ -63,19 +63,13 @@ public function extract($object) | |||
if (!preg_match('/^(get|has|is)[A-Z]\w*/', $method)) { | |||
continue; | |||
} | |||
|
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.
Can you remove the trailing whitespaces on this line please?
ghost
assigned weierophinney
Oct 1, 2012
weierophinney
added a commit
that referenced
this pull request
Oct 1, 2012
Forward port #2426 Conflicts: tests/ZendTest/Stdlib/HydratorTest.php
This isn't so much a BC break as loosening the conditions. As such, I see it as a hotfix, to be included in 2.0.3. |
weierophinney
added a commit
to zendframework/zend-stdlib
that referenced
this pull request
May 15, 2015
weierophinney
added a commit
to zendframework/zend-stdlib
that referenced
this pull request
May 15, 2015
Forward port zendframework/zendframework#2426 Conflicts: tests/ZendTest/Stdlib/HydratorTest.php
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR breaks compatibility, and I may be wrong, but the code of extracting was strange. If a getter was here but no setter, the current implementation skip the value and does not extract the value (because it wants both the getter and setter, which I can't understand and is not logical from an extraction point of view).
So I remove the need for that, but some tests break, that I remove. I can't honestly understand the use case and in some cases we only have getter (for instance for ID in entities, when you don't want to expose a setter, but still want be able to read the identifier in the form).
If someone can explain me the use case behind this, I can close this PR, but for now I think the current implementation is buggy and does not behave as expected.