betweenLength() public static method

Assert that string length is between min,max lengths.
public static betweenLength ( mixed $value, integer $minLength, integer $maxLength, string | null $message = null, string | null $propertyPath = null, string $encoding = 'utf8' ) : boolean
$value mixed
$minLength integer
$maxLength integer
$message string | null
$propertyPath string | null
$encoding string
return boolean
Exemplo n.º 1
0
 public function testValidBetweenLength()
 {
     Assertion::betweenLength("foo", 0, 3);
     Assertion::betweenLength("址址", 2, 2);
 }
Exemplo n.º 2
0
 /**
  * @param $password
  */
 public function setPassword($password)
 {
     Assertion::betweenLength($password, self::MIN, self::MAX);
     $this->password = HashedPassword::make($password, $this->hasher);
 }