Syntax

namespace App\Entity;
 
use Symfony\Component\Validator\Constraints as Assert;
 
class SomeEntity
{
    /**
     * @Assert\NotBlank()
     */
    protected $someProperty;
}

allowNull

NotBlank allowNull