With Symfony 3.3, I have an entity With NotBlank assert :
class UserContributorVersion
{
/**
* @var string
*
* @ORM\Column(type="string")
* @Assert\NotBlank()
*/
private $name;
/**
* Set name
*
* @param string $name
*/
public function setName(string $name)
{
$this->name = $name;
}
}
But If I validate form with novalidate attribute, I have this error :
Argument 1 passed to AppBundle\Entity\UserContributorVersion::setName() must be of the type string, null given
I don't understand, why force setName(string $name = null) if I have NotBlank assert ?
Thanks you :)
