Deprecated precision option in favor of scale#13717
Conversation
There was a problem hiding this comment.
renaming a protected property is a BC break (we should probably switch it to private in 3.0 btw)
|
Thanks @stof. I've applied some fixes to this PR. |
|
failures look unrelated |
|
👍 |
There was a problem hiding this comment.
If we want forward compat, we should add $scale right now (and keep $precision in sync for BC)
There was a problem hiding this comment.
How can we make 2 properties in sync with eachother?
There was a problem hiding this comment.
alias them by reference ?
There was a problem hiding this comment.
But we could also make all props private in 3.0 as @stof suggested. Would be even better
There was a problem hiding this comment.
In that case, you can't make your code future compatible as you can no longer extend this class for that purpose?
There was a problem hiding this comment.
right, then only the comment needs an update, e.g // @deprecated: will be replaced by a $scale private property in 3.0
|
Please configure the allowed types (null|int) for |
93b74d6 to
f0ee681
Compare
|
I've fixed all remaining comments and created a doc PR. Ready to merge imo ✅ |
There was a problem hiding this comment.
Not sure about the deprecation at all. The class is meant to be extended (and also is extended in symfony itself). This why they are protected. It's just currently the case, that the properties are not needed to be read in subclasses. But making them private makes this impossible.
There was a problem hiding this comment.
But I agree deprecating all makes more sense than just one.
|
The idea lLooks good to me. @wouterj Can you address the comments? |
|
@fabpot I'm a bit unsure what to do:
|
|
ping |
|
For now, I've done (1). If I needed to do anything else, please say so :) |
|
👍 |
1 similar comment
|
👍 |
|
Thank you @wouterj. |
This PR was merged into the 2.7 branch. Discussion ---------- Deprecated precision option in favor of scale | Q | A | ------------- | --- | Bug fix? | no | New feature? | no | BC breaks? | no | Deprecations? | yes | Tests pass? | yes | Fixed tickets | #7383 | License | MIT | Doc PR | symfony/symfony-docs#5005 Scale is the number of digits to the right of the decimal point in a number, precision isn't. See the referenced ticket for more context. Commits ------- 2a2f7e2 Deprecated precision option in favor of scale
This PR was merged into the 2.7 branch. Discussion ---------- Renamed precision option to scale | Q | A | --- | --- | Doc fix? | no | New docs? | yes (symfony/symfony#13717) | Applies to | 2.7+ | Fixed tickets | - Commits ------- 59ac3d5 Renamed precision option to scale
… (WouterJ) This PR was merged into the 2.8 branch. Discussion ---------- [2.8] [Form] Rename CollectionType options for entries Description --- Replaces #13820 for the 2.8 branch. Original description: > `type` and `options` are extremely generic. Prefixing them with `entry_` makes it clear what they are configuring. > About the property deprecation it is the same story as #13717 and I don't know which direction you want me to go. I've tried to apply the comments in the previous PR, but got a bit lost in the normalizers/default closure stuff. I hope I did everything correctly, but please review :) PR Info Table --- | Q | A | ------------- | --- | Bug fix? | no | New feature? | yes | BC breaks? | no | Deprecations? | yes | Tests pass? | yes | Fixed tickets | #7831 | License | MIT | Doc PR | symfony/symfony-docs#5051 Commits ------- 942a237 Rename CollectionType options for entries
… (WouterJ) This PR was merged into the 2.8 branch. Discussion ---------- [2.8] [Form] Rename CollectionType options for entries Description --- Replaces #13820 for the 2.8 branch. Original description: > `type` and `options` are extremely generic. Prefixing them with `entry_` makes it clear what they are configuring. > About the property deprecation it is the same story as symfony/symfony#13717 and I don't know which direction you want me to go. I've tried to apply the comments in the previous PR, but got a bit lost in the normalizers/default closure stuff. I hope I did everything correctly, but please review :) PR Info Table --- | Q | A | ------------- | --- | Bug fix? | no | New feature? | yes | BC breaks? | no | Deprecations? | yes | Tests pass? | yes | Fixed tickets | #7831 | License | MIT | Doc PR | symfony/symfony-docs#5051 Commits ------- 942a237 Rename CollectionType options for entries
… (WouterJ) This PR was merged into the 2.8 branch. Discussion ---------- [2.8] [Form] Rename CollectionType options for entries Description --- Replaces #13820 for the 2.8 branch. Original description: > `type` and `options` are extremely generic. Prefixing them with `entry_` makes it clear what they are configuring. > About the property deprecation it is the same story as symfony/symfony#13717 and I don't know which direction you want me to go. I've tried to apply the comments in the previous PR, but got a bit lost in the normalizers/default closure stuff. I hope I did everything correctly, but please review :) PR Info Table --- | Q | A | ------------- | --- | Bug fix? | no | New feature? | yes | BC breaks? | no | Deprecations? | yes | Tests pass? | yes | Fixed tickets | #7831 | License | MIT | Doc PR | symfony/symfony-docs#5051 Commits ------- 942a237 Rename CollectionType options for entries
Scale is the number of digits to the right of the decimal point in a number, precision isn't. See the referenced ticket for more context.