Skip to content

Commit d7071c7

Browse files
committed
Minor tweak
1 parent ab44ec8 commit d7071c7

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

reference/constraints/Type.rst

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,11 @@ Validator :class:`Symfony\\Component\\Validator\\Constraints\\TypeValidator`
1414
Basic Usage
1515
-----------
1616

17-
This will check if ``emailAddress`` is an instance of ``Symfony\Component\Mime\Address``,
17+
This constraint should be applied to untyped variables/properties. If a property
18+
or variable is typed and you pass a value of a different type, PHP will throw an
19+
exception before this constraint is checked.
20+
21+
The following example checks if ``emailAddress`` is an instance of ``Symfony\Component\Mime\Address``,
1822
``firstName`` is of type ``string`` (using :phpfunction:`is_string` PHP function),
1923
``age`` is an ``integer`` (using :phpfunction:`is_int` PHP function) and
2024
``accessCode`` contains either only letters or only digits (using

0 commit comments

Comments
 (0)