Closed TCB13 closed 1 year ago
Did you created a SQLBoolException
extending AllOfException
? Each rule absolutely needs is counterpart exception class in order to AbstractRule::reportError
to work.
Check out the guide for creating custom rules: https://respect-validation.readthedocs.io/en/latest/custom-rules/
Closed due to inactivity after response. Feel free to reopen if this is still an issue!
Hello,
I was trying to create a validator that is based on existing validators. The idea is to allow the user to input any MySQL/MariaDB valid form of a boolean that can be a real PHP boolean (later on converted to an int by the driver) a int (0 or 1) or a string containing "0" or "1":
Using
->validate()
on that works as expected:Now,
->assert()
seems to be broken if the data is invalid:Is this expected / am I doing it the wrong way or is it a bug?
Side note: I was expecting to be able to extend the
AnyOf
validator for this but since it is a final class I was forced to go around withAllOff
... Maybe this isn't necessary?Respect/Validation version: 2.2.3 PHP: 7.4.1
Thank you!