adds backwards compatible 'between' alias for 'lengthBetween' validation rule

This commit is contained in:
Schlaefer 2014-05-13 16:31:32 +02:00
parent 021d765620
commit 3ac731273e
2 changed files with 16 additions and 2 deletions

View file

@ -109,6 +109,20 @@ class Validation {
return ($length >= $min && $length <= $max);
}
/**
* Alias of Validator::lengthBetween() for backwards compatibility.
*
* @see Validator::lengthBetween()
* @deprecated Deprecated since 2.6, use Validator::lengthBetween() instead.
* @param string $check Value to check for length
* @param integer $min Minimum value in range (inclusive)
* @param integer $max Maximum value in range (inclusive)
* @return boolean Success
*/
public static function between($check, $min, $max) {
return self::lengthBetween($check, $min, $max);
}
/**
* Returns true if field is left blank -OR- only whitespace characters are present in its value
* Whitespace characters include Space, Tab, Carriage Return, Newline