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

44 lines
691 B
PHP
Raw Normal View History

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