Sergei Predvoditelev

Results 264 comments of Sergei Predvoditelev

Throw exception is not validator task. If it need, then should be code that process validator results and throw exception if need.

> Can you use this instead? > > ``` > new Nested([ > 'tag' => new Callback(static fn() => (new Result())->addError('Too short.')), > ]); > ``` Yes, it's work. But...

> Example: String Validator Max Length=30 gets an array. On a HTML form with a normal input field this can not happen so if this happens we can not tell...

> In case of "little hacker" it's better to additionally log such request My thoughts for implementation: 1) Add to validation errors property `code` with unique code by each error...

`Expression` use `callable` as parameter?

Is there an example of a translation with a similar problem? Usage keys added new dependency `yiisoft/translator-message-php`.

`CallableRuleInterface` is not rule, it's callable only.

> What do you mean by `it's callable only`? It's not rule. Object does not implement `RuleInterface`.