You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Let's say I have a list of rules for all of the attributes of an object: Validator::key('attr_1', Validator::rule_1()->rule_2()->rule_3()) ->key('attr_2, Validator::rule_1()->rule_2()->rule_3())
Now, if I want to validate the entire object that's all well and good, but with PHP's ArrayObject (and other classes implementing ArrayAccess) you can go things like $obj['attr_1'] = 'foo'. However, in situations where I'm doing this I can't validate since ALL rules are being evaluated.
What if not everything is set yet? I do want exceptions thrown if an invalid value is set for a specific attribute, but I do not want to check all of the rules.
Is there a way to check only the rules for a specific key if all of the keys and their rules have been predefined?
The text was updated successfully, but these errors were encountered:
PatrickSJ
changed the title
Using validators with ArrayObject's offsetSet
Using validators with ArrayObject's offsetSet?
Nov 23, 2017
With so many open issues, it's become hard to really know what's really important and what I have fixed already.
I'm closing issues that are too old, and I'm not really looking at them all. If this is still relevant, please comment here and I will reopen this issue.
Let's say I have a list of rules for all of the attributes of an object:
Validator::key('attr_1', Validator::rule_1()->rule_2()->rule_3()) ->key('attr_2, Validator::rule_1()->rule_2()->rule_3())
Now, if I want to validate the entire object that's all well and good, but with PHP's ArrayObject (and other classes implementing ArrayAccess) you can go things like
$obj['attr_1'] = 'foo'
. However, in situations where I'm doing this I can't validate since ALL rules are being evaluated.What if not everything is set yet? I do want exceptions thrown if an invalid value is set for a specific attribute, but I do not want to check all of the rules.
Is there a way to check only the rules for a specific key if all of the keys and their rules have been predefined?
The text was updated successfully, but these errors were encountered: