ZF-1769: Zend_Validate_StringLength allows max to be lower than min...
I'm using Zend_Validate_StringLength and having a problem. I jumped into the code to see if something was going on in the class that would help explain what I was seeing. Although I haven't gotten to the bottom of that particular problem, while looking over the code I noticed that there is no check when min or max is set to see if min is set to a value higher than max or if max is set to a value lower than min.
While writing this, I did consider the possibilty that there may be value in having min higher than max, but I couldn't think of anything in particular.
I marked this as trivial because I don't think it will be bothering people. BUT, unless there's a good reason not to, it may be a good idea to throw an exception in such circumstances to alert the developer that they're (probably) not using the validator properly....perhaps yielding unexpected results. Or worse yet, perhaps they'll get false positives or false negatives.
I have not actually executed any test, but am pretty sure that the validation will always fail. Throwing an exception when min and max are "backward" may simply save the developer some time troubleshooting.
I hope that's not too confusing. Please feel free to let me know if you have any questions.