The case seemed fairly simple, there is a DTO object containing
class ConfirmationMessageDto
{
/**
* @var mixed
*
* @Assert\NotNull
* @Assert\Type(type = "bool")
*/
protected $success;
/**
* @var mixed
*
* @Assert\Type(type = "string")
*/
protected $errorMessage;
[setters and getters]
}
Now I'd like it to validate if the errorMessage is not null when $success === false. Can I do it in a simple way?