Open vjik opened 1 year ago
Can you use this instead?
new Nested([
'tag' => new Callback(static fn() => (new Result())->addError('Too short.')),
]);
Can you use this instead?
new Nested([ 'tag' => new Callback(static fn() => (new Result())->addError('Too short.')), ]);
Yes, it's work. But my suggestion is more simpler and consistently with rules syntax that pass to Validator
.
For Example:
Now it's throw exception: