Passed
Pull Request — 1.11.x (#4350)
by Angel Fernando Quiroz
09:23
created

HTML_QuickForm_Rule_NoSameCurrentPassword   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 8
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 1
eloc 3
c 1
b 0
f 0
dl 0
loc 8
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A validate() 0 6 1
1
<?php
2
3
/* For licensing terms, see /license.txt */
4
5
use Chamilo\UserBundle\Entity\User;
6
7
class HTML_QuickForm_Rule_NoSameCurrentPassword extends HTML_QuickForm_Rule
8
{
9
    public function validate($value, $options)
10
    {
11
        /** @var User $user */
12
        $user = $options;
13
14
        return !UserManager::isPasswordValid($user->getPassword(), $value, $user->getSalt());
15
    }
16
}
17