@@ -13,6 +13,17 @@ type guessers.
13
13
* :class: `Symfony\\ Bridge\\ Doctrine\\ Form\\ DoctrineOrmTypeGuesser `
14
14
provided by the Doctrine bridge.
15
15
16
+ Guessers are used only in the following cases:
17
+
18
+ * Using
19
+ :method: `Symfony\\ Component\\ Form\\ FormFactoryInterface::createForProperty `
20
+ or
21
+ :method: `Symfony\\ Component\\ Form\\ FormFactoryInterface::createBuilderForProperty `;
22
+ * Calling :method: `Symfony\\ Component\\ Form\\ FormInterface::add ` or
23
+ :method: `Symfony\\ Component\\ Form\\ FormBuilderInterface::create ` or
24
+ :method: `Symfony\\ Component\\ Form\\ FormBuilderInterface::add ` without an
25
+ explicit type, in a context where the parent form has defined a data class.
26
+
16
27
Create a PHPDoc Type Guesser
17
28
----------------------------
18
29
@@ -70,7 +81,7 @@ The ``TypeGuess`` constructor requires three options:
70
81
71
82
* The type name (one of the :doc: `form types </reference/forms/types >`);
72
83
* Additional options (for instance, when the type is ``entity ``, you also
73
- want to set the ``class `` option). If no types are guessed, this should be
84
+ want to set the ``class `` option). If no options are guessed, this should be
74
85
set to an empty array;
75
86
* The confidence that the guessed type is correct. This can be one of the
76
87
constants of the :class: `Symfony\\ Component\\ Form\\ Guess\\ Guess ` class:
@@ -153,11 +164,11 @@ set.
153
164
154
165
.. caution ::
155
166
156
- You should be very careful using the ``guessPattern () `` method. When the
157
- type is a float, you cannot use it to determine a min or max value of the
158
- float (e.g. you want a float to be greater than ``5 ``, ``4 .512313 `` is not valid
159
- but ``length(4 .512314) > length(5) `` is, so the pattern will succeed). In
160
- this case, the value should be set to ``null `` with a ``MEDIUM_CONFIDENCE ``.
167
+ You should be very careful using the ``guessMaxLength () `` method. When the
168
+ type is a float, you cannot determine a length (e.g. you want a float to be
169
+ less than ``5 ``, ``5 .512313 `` is not valid but
170
+ ``length(5 .512314) > length(5) `` is, so the pattern will succeed). In this
171
+ case, the value should be set to ``null `` with a ``MEDIUM_CONFIDENCE ``.
161
172
162
173
Registering a Type Guesser
163
174
--------------------------
0 commit comments