8000 [Validator] Update "ltrim" and "rtrim" options in the Length constrai… · symfony/symfony-docs@0728303 · GitHub
[go: up one dir, main page]

Skip to content

Commit 0728303

Browse files
committed
[Validator] Update "ltrim" and "rtrim" options in the Length constraint page
1 parent 568fb96 commit 0728303

File tree

2 files changed

+18
-24
lines changed

2 files changed

+18
-24
lines changed

reference/constraints/Length.rst

Lines changed: 1 addition & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -133,30 +133,6 @@ max
133133
This required option is the "max" length value. Validation will fail if
134134
the given value's length is **greater** than this max value.
135135

136-
ltrim
137-
~~~~~
138-
139-
**type**: ``boolean`` **default**: ``null``
140-
141-
If ``true``, every kind of whitespace from the **beginning** of the given value
142-
will be ignored while checking for its length.
143-
144-
rtrim
145-
~~~~~
146-
147-
**type**: ``boolean`` **default**: ``null``
148-
149-
If ``true``, every kind of whitespace from the **end** of the given value will
150-
be ignored while checking for its length.
151-
152-
mergeConsecutiveWhitespaces
153-
~~~~~~~~~~~~~~~~~~~~~~~~~~~
154-
155-
**type**: ``boolean`` **default**: ``null``
156-
157-
If ``true``, consecutive whitespaces will count as a single character while
158-
checking for the given value's length.
159-
160136
charset
161137
~~~~~~~
162138

@@ -191,4 +167,5 @@ exactMessage
191167
The message that will be shown if min and max values are equal and the underlying
192168
value's length is not exactly this value.
193169

170+
.. include:: /reference/constraints/_ltrim-rtim-options.rst.inc
194171
.. include:: /reference/constraints/_payload-option.rst.inc
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
ltrim
2+
~~~~~
3+
4+
**type**: ``boolean`` **default**: ``false``
5+
6+
If ``true``, then the :phpfunction:`ltrim` PHP function will be used in order to
7+
ignore leading whitespace characters in the given value while checking if it is
8+
valid.
9+
10+
rtrim
11+
~~~~~
12+
13+
**type**: ``boolean`` **default**: ``false``
14+
15+
If ``true``, then the :phpfunction:`rtrim` PHP function will be used in order to
16+
ignore trailing whitespace characters in the given value while checking if it is
17+
valid.

0 commit comments

Comments
 (0)
0