https://g.co/gemini/share/2c2740dcf5de


This constraint compares using ==, so 3 and "3" are considered equal. Use IdenticalTo to compare with ===.


// src/Entity/Person.php
namespace App\Entity;

use Symfony\Component\Validator\Constraints as Assert;

class Person
{
    #[Assert\EqualTo('Mary')]
    protected string $firstName;

    #[Assert\EqualTo(
        value: 20,
    )]
    protected int $age;
}

Powered by Froala Editor