fix(continuous-integration): correction php-cs-fixer
All checks were successful
Cadoles/nineskeletor/pipeline/pr-master This commit looks good
All checks were successful
Cadoles/nineskeletor/pipeline/pr-master This commit looks good
This commit is contained in:
@ -1,4 +1,5 @@
|
||||
<?php
|
||||
|
||||
namespace App\Validator;
|
||||
|
||||
use Symfony\Component\Validator\Constraint;
|
||||
@ -11,19 +12,16 @@ class PasswordValidator extends ConstraintValidator
|
||||
{
|
||||
public function validate($value, Constraint $constraint)
|
||||
{
|
||||
if(!empty($value)) {
|
||||
if (!empty($value)) {
|
||||
if (strlen($value) < '8') {
|
||||
$this->context->addViolation($constraint->message);
|
||||
}
|
||||
elseif(!preg_match("#[0-9]+#",$value)) {
|
||||
} elseif (!preg_match('#[0-9]+#', $value)) {
|
||||
$this->context->addViolation($constraint->message);
|
||||
} elseif (!preg_match('#[a-zA-Z]+#', $value)) {
|
||||
$this->context->addViolation($constraint->message);
|
||||
} elseif (!preg_match("/[|!@#$%&*\/=?,;.:\-_+~^\\\]/", $value)) {
|
||||
$this->context->addViolation($constraint->message);
|
||||
}
|
||||
elseif(!preg_match("#[a-zA-Z]+#",$value)) {
|
||||
$this->context->addViolation($constraint->message);
|
||||
}
|
||||
elseif(!preg_match("/[|!@#$%&*\/=?,;.:\-_+~^\\\]/",$value)) {
|
||||
$this->context->addViolation($constraint->message);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user