appwrite/src/Auth/Validator/Password.php
eldadfux 35680bbae9 Run PHP-CS-FIXER to make sure
code is consisted with PSR-1 + PSR-2
2019-09-06 20:04:26 +03:00

43 lines
680 B
PHP
Executable file

<?php
namespace 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;
}
}