I have encourred a strange problem when use a Symfony validator, the constraints violations is always empty even if entity does not respect constraints.
Entity :
use Symfony\Component\Validator\Constraints as Assert;
class Author
{
/**
* @Assert\NotBlank()
*/
public $name;
}
The code to use validator :
$Author = new Author();
$validator = Validation::createValidator();
var_dump( count($validator-> validate($Author)) );
Result : 0
Do you have an idea on the origin of this problem ?
Thanks in advance.
Jérémy