Validation rules like integer and boolean, for instance, allow passing string values to them. I had a use case to only allow strict types (I'm storing IoT configurations that will be sent to the device, and the parser at that end complains when "integer" values aren't real integers").
Suggestion
We could add a strict flag on those validation rules, like: integer:strict and boolean:strict that would also check for strictness using is_integer and is_bool.
My suggestion is to introduce a general rule type:... where type can be one or many of array, object, string, integer, number, bool, null. Also some alternative for in rule like Rule::strict(true, false).
Validation rules like
integer
andboolean
, for instance, allow passing string values to them. I had a use case to only allow strict types (I'm storing IoT configurations that will be sent to the device, and the parser at that end complains when "integer" values aren't real integers").Suggestion
We could add a
strict
flag on those validation rules, like:integer:strict
andboolean:strict
that would also check for strictness usingis_integer
andis_bool
.Thoughts?