The CombinatorRule would:
- accept:
- array of rules as input
- constraint (as all rules do)
test method will:
- call the
test method on each of rules given in constructor
- add +1 on each sub-rule match
- use constraint to check
count of matched sub-rules
- if not enough sub-rules matched then combine error messages from sub-rules using
or (not sure this is best way to build error message)
P.S.
This proposal is far more easier to implement than one in #7.
The
CombinatorRulewould:testmethod will:testmethod on each of rules given in constructorcount of matched sub-rulesor(not sure this is best way to build error message)P.S.
This proposal is far more easier to implement than one in #7.