Skip to content

Commit 3e22051

Browse files
committed
Merge pull request symfony#3306 from xabbuh/issue-3272
add note on return values when null is passed to a data transformer's tr...
2 parents 899b48a + 8189574 commit 3e22051

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

cookbook/form/data_transformers.rst

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,12 @@ for converting to and from the issue number and the ``Issue`` object::
9797
If you want a new issue to be created when an unknown number is entered, you
9898
can instantiate it rather than throwing the ``TransformationFailedException``.
9999

100+
.. note::
101+
102+
When ``null`` is passed to the ``transform()`` method, your transformer
103+
should return an equivalent value of the type it is transforming to (e.g.
104+
an empty string, 0 for integers or 0.0 for floats).
105+
100106
Using the Transformer
101107
---------------------
102108

0 commit comments

Comments
 (0)