The "NestedValidationException" does not work in this form. Is there a solution for this?
try {
$validator = new Rules\Optional(new Rules\Digit());
$validator->assert($data);
return null;
} catch(NestedValidationException $e) {
return current($e->getMessages([
'digit' => 'error message',
]));
}