I have a Model and an attribute $test
.
I have an annotation
for an assert Max-length. But I don't want to count the whitespaces, only the characters. So the text
MUST have 40 characters and not a mix of 40 characters with whitespace. Is this possible?
/**
* @var string
*
* @Assert\NotBlank(message = "text.length.error")
* @Assert\Length(
* max = 40,
* maxMessage = "Only 40 letters."
* )
*/
protected $text;