https://g.co/gemini/share/cc6afb950212


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


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

use Symfony\Component\Validator\Constraints as Assert;

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

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

Powered by Froala Editor