Skip to content

Commit 458fdd5

Browse files
committed
[Validator] Update Type constraint, add number, finite-float and finite-number validations
1 parent 3a54a22 commit 458fdd5

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

reference/constraints/Type.rst

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -208,5 +208,14 @@ Also, you can use ``ctype_*()`` functions from corresponding
208208
Make sure that the proper :phpfunction:`locale <setlocale>` is set before
209209
using one of these.
210210

211+
Finally, you can use aggregated functions:
212+
213+
* ``number``: ``is_int || is_float && !is_nan``
214+
* ``finite-float``: ``is_float && is_finite``
215+
* ``finite-number``: ``is_int || is_float && is_finite``
216+
217+
.. versionadded:: 6.4
218+
``number``, ``finite-float`` and ``finite-number`` were introduced in Symfony 6.4.
219+
211220
.. _built-in PHP extension: https://www.php.net/book.ctype
212221
.. _a list of ctype functions: https://www.php.net/ref.ctype

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy