Alexander Borisov

Results 48 comments of Alexander Borisov

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

FYI, in symfony such cases generate exceptions not violations (e.g. https://github.com/symfony/validator/blob/6.2/Constraints/BicValidator.php#L69)

In case of "little hacker" it's better to additionally log such request

FYI there is package for that: https://github.com/giggsey/libphonenumber-for-php

Looks like a separate package `yiisoft/validator-phone` with `giggsey/libphonenumber-for-php` as a dependency or put rule in `yiisoft/validator` and add `giggsey/libphonenumber-for-php` in composer's `suggest` section

What an expected result for value e.g. `not-a-number` in that case?

@vjik your example meant to accept numbers not in range `7` and `12` but it also accepts not valid numbers. And it may be not obvious to add additional `Number`...

It shows that you can't invert all rules. E.g. `new Not(new TrueValue())` will accept incorrect input

Can't find a way where .env files are used. Are they only for example?

If you set message in your language but not change message processing nothing changes, isn't it? Translator can't handle it and leaves it as is