Skip to content

Commit

Permalink
drop type-hints for properties where the Type constraint is used
Browse files Browse the repository at this point in the history
  • Loading branch information
xabbuh committed Jul 23, 2024
1 parent a26d9d3 commit 27a06be
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions reference/constraints/Type.rst
Original file line number Diff line number Diff line change
Expand Up @@ -33,19 +33,19 @@ This will check if ``emailAddress`` is an instance of ``Symfony\Component\Mime\A
class Author
{
#[Assert\Type(Address::class)]
protected Address $emailAddress;
protected $emailAddress;
#[Assert\Type('string')]
protected string $firstName;
protected $firstName;
#[Assert\Type(
type: 'integer',
message: 'The value {{ value }} is not a valid {{ type }}.',
)]
protected int $age;
protected $age;
#[Assert\Type(type: ['alpha', 'digit'])]
protected string $accessCode;
protected $accessCode;
}
.. code-block:: yaml
Expand Down

0 comments on commit 27a06be

Please sign in to comment.