1
0
Fork 0
mirror of synced 2024-06-02 19:04:49 +12:00
appwrite/src/Appwrite/Auth/Validator/Password.php
2020-03-24 19:56:32 +02:00

44 lines
689 B
PHP

<?php
namespace Appwrite\Auth\Validator;
use Utopia\Validator;
/**
* Password.
*
* Validates user password string
*/
class Password extends Validator
{
/**
* Get Description.
*
* Returns validator description
*
* @return string
*/
public function getDescription()
{
return 'Password must be between 6 and 32 chars and contain ...';
}
/**
* Is valid.
*
* Validation username
*
* @param mixed $value
*
* @return bool
*/
public function isValid($value)
{
if (strlen($value) < 6 || strlen($value) > 32) {
return false;
}
return true;
}
}