Skip to content

[Form] Removed Integer scale option #9542

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

Closed
wants to merge 3 commits into from
Closed

Conversation

dlabouesse
Copy link
Contributor

@dlabouesse dlabouesse commented Apr 3, 2018

Scale option is hardcoded for IntegerType.
These changes result from the discussion introduced by symfony/symfony#26734.

@@ -47,37 +41,6 @@ Field Options

.. include:: /reference/forms/types/options/grouping.rst.inc

.. include:: /reference/forms/types/options/scale.rst.inc

rounding_mode
Copy link
Member

Choose a reason for hiding this comment

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

Are you sure that the rounding_mode option is not used?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Copy link
Member

Choose a reason for hiding this comment

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

That's only the default value. But inside the form type's buildForm() method the option is passed to the transformer and it will be used then.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ooops! Yes you're right. Sorry for my mistake. I've updated the changes accordingly.
BTW, scale.rst.inc file is now only included in number.rst file, so shall we copy it's content directly to into number.rst to remove the scale.rst.inc file?

Copy link
Member

Choose a reason for hiding this comment

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

Moving the text makes sense to me.

Scale option is hardcoded for IntegerType.
These changes result from the discussion introduced by
symfony/symfony#26734.
@dlabouesse dlabouesse changed the title [Form] Removed Integer rounding-related options [Form] Removed Integer scale option Apr 5, 2018
Copy link
Contributor

@HeahDude HeahDude left a comment

Choose a reason for hiding this comment

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

Thanks @dlabouesse for spotting and taking care of this issue. I've left a comment, please tell me what you think and wait for other reviews before making the change.

Ping @xabbuh

@@ -17,7 +17,6 @@ integers. By default, all non-integer values (e.g. 6.78) will round down
| Rendered as | ``input`` ``number`` field |
+-------------+-----------------------------------------------------------------------+
| Options | - `grouping`_ |
| | - `scale`_ |
Copy link
Contributor

Choose a reason for hiding this comment

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

IMHO we should better move it to the Overridden section, saying that the reverse transformation cast the value to an integer, ignoring the scale option at this point.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Hi @HeahDude! Sorry for my late reply.
I'm not really convinced by the interest of keeping this point in the documentation if the user can not customize its behavior by any way. As any value that might have been set by the user to scale of IntegerType will be overridden by 0, it make sense for me to remove this section from its documentation.

Copy link
Contributor

Choose a reason for hiding this comment

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

I understand, but this option is defined anyway and the type can still be extended to customize the transformation process. I would prefer to document the option and its overridden behavior instead of not mentioning anything.

@javiereguiluz
Copy link
Member

@dlabouesse thanks a lot for taking care of improving the doc of this option. Thanks also for making all the changes suggested by reviewers (and thanks to them for the reviews!) Finally, congrats on your first Symfony Docs contribution!

javiereguiluz added a commit that referenced this pull request Apr 27, 2018
This PR was squashed before being merged into the 2.7 branch (closes #9542).

Discussion
----------

[Form] Removed Integer scale option

Scale option is hardcoded for IntegerType.
These changes result from the discussion introduced by symfony/symfony#26734.

<!--

If your pull request fixes a BUG, use the oldest maintained branch that contains
the bug (see https://symfony.com/roadmap for the list of maintained branches).

If your pull request documents a NEW FEATURE, use the same Symfony branch where
the feature was introduced (and `master` for features of unreleased versions).

-->

Commits
-------

2f61f75 [Form] Removed Integer scale option
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